commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1130046 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/DigesterLoader.java
Date Wed, 01 Jun 2011 08:36:13 GMT
Author: simonetripodi
Date: Wed Jun  1 08:36:13 2011
New Revision: 1130046

URL: http://svn.apache.org/viewvc?rev=1130046&view=rev
Log:
added missing EntityResolver in the loader

Modified:
    commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/DigesterLoader.java

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/DigesterLoader.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/DigesterLoader.java?rev=1130046&r1=1130045&r2=1130046&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/DigesterLoader.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/DigesterLoader.java
Wed Jun  1 08:36:13 2011
@@ -41,6 +41,7 @@ import org.apache.commons.digester3.Rule
 import org.apache.commons.digester3.RulesBase;
 import org.apache.commons.digester3.StackAction;
 import org.apache.commons.digester3.Substitutor;
+import org.xml.sax.EntityResolver;
 import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
 
@@ -117,6 +118,11 @@ public final class DigesterLoader
     private Substitutor substitutor;
 
     /**
+     * The EntityResolver used by the SAX parser. By default it use this class
+     */
+    private EntityResolver entityResolver;
+
+    /**
      * Object which will receive callbacks for every pop/push action on the default stack
or named stacks.
      */
     private StackAction stackAction;
@@ -265,7 +271,7 @@ public final class DigesterLoader
      * a local version without having to ensure every <code>SYSTEM</code>
      * URI on every processed xml document is local. This implementation provides
      * only basic functionality. If more sophisticated features are required,
-     * using {@link #setEntityResolver} to set a custom resolver is recommended.
+     * using {@link #setEntityResolver(EntityResolver)} to set a custom resolver is recommended.
      * </p><p>
      * <strong>Note:</strong> This method will have no effect when a custom 
      * <code>EntityResolver</code> has been set. (Setting a custom 
@@ -312,6 +318,19 @@ public final class DigesterLoader
     }
 
     /**
+     * Set the <code>EntityResolver</code> used by SAX when resolving public
id and system id. This must be called
+     * before the first call to <code>parse()</code>.
+     * 
+     * @param entityResolver a class that implement the <code>EntityResolver</code>
interface.
+     * @return This loader instance, useful to chain methods.
+     */
+    public DigesterLoader setEntityResolver( EntityResolver entityResolver )
+    {
+        this.entityResolver = entityResolver;
+        return this;
+    }
+
+    /**
      * Sets the Object which will receive callbacks for every pop/push action on the default
stack or named stacks.
      *
      * @param stackAction the Object which will receive callbacks for every pop/push action
on the default stack
@@ -428,6 +447,7 @@ public final class DigesterLoader
         digester.setRules( rules );
         digester.setSubstitutor( substitutor );
         digester.registerAll( entityValidator );
+        digester.setEntityResolver( entityResolver );
         digester.setStackAction( stackAction );
         digester.setNamespaceAware( isNamespaceAware() );
 



Mime
View raw message