forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r485907 - in /forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document: InternalDocument.java InternalErrorDocument.java
Date Mon, 11 Dec 2006 22:10:23 GMT
Author: rgardler
Date: Mon Dec 11 14:10:22 2006
New Revision: 485907

URL: http://svn.apache.org/viewvc?view=rev&rev=485907
Log:
Keep tabs on the source document that created this internal document so that we have tracability
(particularly useful in error messages)

Modified:
    forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalDocument.java
    forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalErrorDocument.java

Modified: forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalDocument.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalDocument.java?view=diff&rev=485907&r1=485906&r2=485907
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalDocument.java
(original)
+++ forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalDocument.java
Mon Dec 11 14:10:22 2006
@@ -24,13 +24,36 @@
  * 
  */
 public class InternalDocument extends AbstractDocument {
+	
+	private AbstractSourceDocument sourceDocument;
 
-	public InternalDocument() {
+	public InternalDocument(AbstractSourceDocument sourceDoc) {
+		setSourceDocument(sourceDoc);
 	}
 
-	public InternalDocument(final URI requestURI, final String content) {
-		this.setRequestURI(requestURI);
+	public InternalDocument(AbstractSourceDocument sourceDoc, final String content) {
+		setSourceDocument(sourceDoc);
+		this.setRequestURI(sourceDoc.getRequestURI());
 		this.setContent(content);
 	}
 
+	/**
+	 * Get the source document that resulted in this
+	 * document being created.
+	 * 
+	 * @return
+	 */
+	public AbstractSourceDocument getSourceDocument() {
+		return sourceDocument;
+	}
+
+	/**
+	 * Set the source documen that was used to create this
+	 * internal document.
+	 * 
+	 * @param sourceDocument
+	 */
+	public void setSourceDocument(AbstractSourceDocument sourceDocument) {
+		this.sourceDocument = sourceDocument;
+	}
 }

Modified: forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalErrorDocument.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalErrorDocument.java?view=diff&rev=485907&r1=485906&r2=485907
==============================================================================
--- forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalErrorDocument.java
(original)
+++ forrest/trunk/whiteboard/forrest2/core/src/core/org/apache/forrest/core/document/InternalErrorDocument.java
Mon Dec 11 14:10:22 2006
@@ -5,8 +5,8 @@
 
 public class InternalErrorDocument extends InternalDocument {
 
-	public InternalErrorDocument(URI requestURI, String message) {
-		super (requestURI, message);
+	public InternalErrorDocument(AbstractSourceDocument sourceDoc, String message) {
+		super (sourceDoc, message);
 	}
 
 	@Override



Mime
View raw message