commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject cvs commit: jakarta-commons/digester/src/java/org/apache/commons/digester/plugins PluginRules.java
Date Sun, 28 Mar 2004 06:16:17 GMT
skitching    2004/03/27 22:16:17

  Modified:    digester/src/java/org/apache/commons/digester/plugins Tag:
                        DIGESTER_PLUGIN_REFACTORING_BRANCH PluginRules.java
  Log:
  * the "root" PluginRules object for a Digester now creates an instance of
    PerDigesterResources, others get a ref to a pre-existing one
  * added getter/setter methods to acecss data on the underlying
    PerDigesterResources object. Some of these methods were previously
    on the PluginCreateRules class.
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.12.2.1  +60 -7     jakarta-commons/digester/src/java/org/apache/commons/digester/plugins/PluginRules.java
  
  Index: PluginRules.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/plugins/PluginRules.java,v
  retrieving revision 1.12
  retrieving revision 1.12.2.1
  diff -u -r1.12 -r1.12.2.1
  --- PluginRules.java	23 Mar 2004 07:11:00 -0000	1.12
  +++ PluginRules.java	28 Mar 2004 06:16:17 -0000	1.12.2.1
  @@ -82,6 +82,12 @@
        */
       private PluginRules parent = null;
       
  +    /**
  +     * A reference to the object that holds all data which should only
  +     * exist once per digester instance.
  +     */
  +    private PerDigesterResources perDigesterResources = null;
  +    
       // ------------------------------------------------------------- Constructor
       
       /**
  @@ -90,8 +96,7 @@
        * object before parsing starts.
        */
       public PluginRules() {
  -        decoratedRules = new RulesBase();
  -        pluginManager = new PluginManager();
  +        this(new RulesBase());
       }
   
       /**
  @@ -100,7 +105,9 @@
        */
       public PluginRules(Rules decoratedRules) {
           this.decoratedRules = decoratedRules;
  -        pluginManager = new PluginManager();
  +
  +        perDigesterResources = new PerDigesterResources();
  +        pluginManager = new PluginManager(perDigesterResources);
       }
   
       /**
  @@ -117,7 +124,8 @@
           // method on this object will be called.
           
           decoratedRules = new RulesBase();
  -        pluginManager = new PluginManager(parent.pluginManager);
  +        perDigesterResources = parent.perDigesterResources;
  +        pluginManager = new PluginManager(perDigesterResources, parent.pluginManager);
           
           this.mountPoint = mountPoint;
           this.parent = parent;
  @@ -177,7 +185,21 @@
       public PluginManager getPluginManager() {
           return pluginManager;
       }
  -
  +    
  +    /**
  +     * See {@link PerDigesterResources#getRuleFinders}.
  +     */
  +    public List getRuleFinders() {
  +        return perDigesterResources.getRuleFinders();
  +    }
  +    
  +    /**
  +     * See {@link PerDigesterResources#setRuleFinders}.
  +     */
  +    public void setRuleFinders(List ruleFinders) {
  +        perDigesterResources.setRuleFinders(ruleFinders);
  +    }
  +    
       // --------------------------------------------------------- Public Methods
   
       /**
  @@ -329,11 +351,42 @@
               // even though this object may hold some rules matching
               // this same path. See PluginCreateRule's begin, body and end
               // methods for the reason.
  -        } 
  -        else {
  +        } else {
               matches = decoratedRules.match(namespaceURI, path); 
           }
   
           return matches;
  +    }
  +
  +    /** See {@link PerDigesterResources#setPluginClassAttribute}. */
  +    public void setPluginClassAttribute(String namespaceUri, 
  +                                        String attrName) {
  +        perDigesterResources.setPluginClassAttribute(namespaceUri, attrName);
  +    }
  +
  +    /** See {@link PerDigesterResources#setPluginIdAttribute}. */
  +    public void setPluginIdAttribute(String namespaceUri, 
  +                                     String attrName) {
  +        perDigesterResources.setPluginIdAttribute(namespaceUri, attrName);
  +    }
  +    
  +    /** See {@link PerDigesterResources#getPluginClassAttrNs}. */
  +    public String getPluginClassAttrNs() {
  +        return perDigesterResources.getPluginClassAttrNs();
  +    }
  +    
  +    /** See {@link PerDigesterResources#getPluginClassAttr}. */
  +    public String getPluginClassAttr() {
  +        return perDigesterResources.getPluginClassAttr();
  +    }
  +    
  +    /** See {@link PerDigesterResources#getPluginIdAttrNs}. */
  +    public String getPluginIdAttrNs() {
  +        return perDigesterResources.getPluginIdAttrNs();
  +    }
  +    
  +    /** See {@link PerDigesterResources#getPluginIdAttr}. */
  +    public String getPluginIdAttr() {
  +        return perDigesterResources.getPluginIdAttr();
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message