You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by tc...@apache.org on 2005/02/07 20:00:48 UTC

svn commit: r151741 - excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java

Author: tcurdt
Date: Mon Feb  7 11:00:47 2005
New Revision: 151741

URL: http://svn.apache.org/viewcvs?view=rev&rev=151741
Log:
selectable entity resolver


Modified:
    excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java

Modified: excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java?view=diff&r1=151740&r2=151741
==============================================================================
--- excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java (original)
+++ excalibur/trunk/components/xmlutil/src/java/org/apache/excalibur/xml/impl/JaxpParser.java Mon Feb  7 11:00:47 2005
@@ -118,6 +118,9 @@
     /** do we stop on recoverable errors ? */
     private boolean m_stopOnRecoverableError;
 
+    /** the hint to the entity resolver */
+    private String m_resolverHint;
+
     /** the Document Builder factory */
     private DocumentBuilderFactory m_docFactory;
 
@@ -143,7 +146,17 @@
         
         if( manager.hasService( EntityResolver.ROLE ) )
         {
-            m_resolver = (EntityResolver)manager.lookup( EntityResolver.ROLE );
+            if ( m_resolverHint != null )
+            {
+                // select the configured resolver
+                m_resolver = (EntityResolver)manager.lookup( EntityResolver.ROLE + "/" + m_resolverHint );
+            }
+            else
+            {
+                // use default resolver
+                m_resolver = (EntityResolver)manager.lookup( EntityResolver.ROLE );
+            }
+    
             if( getLogger().isDebugEnabled() )
             {
                 getLogger().debug( "JaxpParser: Using EntityResolver: " + m_resolver );
@@ -174,6 +187,7 @@
         m_stopOnWarning = params.getParameterAsBoolean( "stop-on-warning", true );
         m_stopOnRecoverableError = params.getParameterAsBoolean( "stop-on-recoverable-error", true );
         m_dropDtdComments = params.getParameterAsBoolean( "drop-dtd-comments", false );
+        m_resolverHint = params.getParameterAsString( "resolver-hint", null );
 
         // Get the SAXFactory
         final String saxParserFactoryName = params.getParameter( "sax-parser-factory",
@@ -227,7 +241,8 @@
                                ", stop on warning: " + m_stopOnWarning +
                                ", stop on recoverable-error: " + m_stopOnRecoverableError +
                                ", saxParserFactory: " + saxParserFactoryName +
-                               ", documentBuilderFactory: " + documentBuilderFactoryName );
+                               ", documentBuilderFactory: " + documentBuilderFactoryName +
+                               ", resolver hint: " + m_resolverHint );
         }
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org