forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgard...@apache.org
Subject svn commit: r476408 - /forrest/trunk/whiteboard/forrest2/test/org/apache/forrest/test/core/readers/HelloReader.java
Date Sat, 18 Nov 2006 01:40:34 GMT
Author: rgardler
Date: Fri Nov 17 17:40:32 2006
New Revision: 476408

URL: http://svn.apache.org/viewvc?view=rev&rev=476408
Log:
Test new reader chaiing feature

Modified:
    forrest/trunk/whiteboard/forrest2/test/org/apache/forrest/test/core/readers/HelloReader.java

Modified: forrest/trunk/whiteboard/forrest2/test/org/apache/forrest/test/core/readers/HelloReader.java
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/forrest2/test/org/apache/forrest/test/core/readers/HelloReader.java?view=diff&rev=476408&r1=476407&r2=476408
==============================================================================
--- forrest/trunk/whiteboard/forrest2/test/org/apache/forrest/test/core/readers/HelloReader.java
(original)
+++ forrest/trunk/whiteboard/forrest2/test/org/apache/forrest/test/core/readers/HelloReader.java
Fri Nov 17 17:40:32 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.forrest.test.core.readers;
 
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 
@@ -23,11 +24,13 @@
 import org.apache.forrest.core.document.DefaultSourceDocument;
 import org.apache.forrest.core.locationMap.Location;
 import org.apache.forrest.reader.FileReader;
+import org.apache.forrest.reader.IReader;
+import org.springframework.context.support.AbstractXmlApplicationContext;
 
 public class HelloReader extends FileReader {
 
 	@Override
-	public AbstractSourceDocument read(final Location location) {
+	public AbstractSourceDocument read(AbstractXmlApplicationContext context, final Location
location) {
 		DefaultSourceDocument doc = null;
 		final URI psudeoURI = location.getSourceURI();
 		final String ssp = psudeoURI.getSchemeSpecificPart();
@@ -35,9 +38,14 @@
 		try {
 			uri = new URI(ssp);
 			location.setSourceURI(uri);
-			doc = (DefaultSourceDocument) super.read(location);
+			IReader reader;
+			reader = (IReader) context.getBean(uri.getScheme());
+			doc = (DefaultSourceDocument) reader.read(context, location);
 			doc.setType("org.apache.forrest.helloWorld");
 		} catch (final URISyntaxException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (MalformedURLException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}



Mime
View raw message