maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vsive...@apache.org
Subject svn commit: r772625 - /maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
Date Thu, 07 May 2009 12:00:27 GMT
Author: vsiveton
Date: Thu May  7 12:00:27 2009
New Revision: 772625

URL: http://svn.apache.org/viewvc?rev=772625&view=rev
Log:
o minor improvement for ReaderFactory

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java?rev=772625&r1=772624&r2=772625&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
(original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
Thu May  7 12:00:27 2009
@@ -34,6 +34,7 @@
 import org.apache.maven.doxia.document.io.xpp3.DocumentXpp3Reader;
 import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.parser.ParseException;
+import org.apache.maven.doxia.parser.Parser;
 import org.apache.maven.doxia.parser.manager.ParserNotFoundException;
 import org.apache.maven.doxia.logging.PlexusLoggerWrapper;
 import org.apache.maven.doxia.module.site.SiteModule;
@@ -312,14 +313,19 @@
         try
         {
             File f = new File( fullDocPath );
-            if ( XmlUtil.isXml( f ) )
-            {
-                reader = ReaderFactory.newXmlReader( f );
-            }
-            else
+
+            Parser parser = doxia.getParser( parserId );
+            switch ( parser.getType() )
             {
-                // TODO Platform dependent?
-                reader = ReaderFactory.newPlatformReader( f );
+                case Parser.XML_TYPE:
+                    reader = ReaderFactory.newXmlReader( f );
+                    break;
+
+                case Parser.TXT_TYPE:
+                case Parser.UNKNOWN_TYPE:
+                default:
+                    // TODO Platform dependent?
+                    reader = ReaderFactory.newPlatformReader( f );
             }
 
             sink.enableLogging( new PlexusLoggerWrapper( getLogger() ) );



Mime
View raw message