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/xmlrules DigesterRuleParser.java digester-rules.dtd
Date Tue, 18 Jan 2005 00:11:12 GMT
skitching    2005/01/17 16:11:12

  Modified:    digester/src/java/org/apache/commons/digester/xmlrules
                        DigesterRuleParser.java digester-rules.dtd
  Log:
  Add support for "stack-index" feature of CallParamRule. Patch by
  Kris Nuttycombe, inspired by Blake Meike.
  
  Revision  Changes    Path
  1.32      +13 -13    jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java
  
  Index: DigesterRuleParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/DigesterRuleParser.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- DigesterRuleParser.java	12 Jan 2005 10:47:03 -0000	1.31
  +++ DigesterRuleParser.java	18 Jan 2005 00:11:12 -0000	1.32
  @@ -577,26 +577,26 @@
               int paramIndex = Integer.parseInt(attributes.getValue("paramnumber"));
               String attributeName = attributes.getValue("attrname");
               String fromStack = attributes.getValue("from-stack");
  +            String stackIndex = attributes.getValue("stack-index");
               Rule callParamRule = null;
  +
               if (attributeName == null) {
  -                if (fromStack == null) {
  -                
  -                    callParamRule = new CallParamRule( paramIndex );
  -                
  +                if (stackIndex != null) {                    
  +                    callParamRule = new CallParamRule(
  +                        paramIndex, Integer.parseInt(stackIndex));                
  +                } else if (fromStack != null) {                
  +                    callParamRule = new CallParamRule(
  +                        paramIndex, Boolean.valueOf(fromStack).booleanValue());       
        
                   } else {
  -
  -                    callParamRule = new CallParamRule( paramIndex, Boolean.valueOf(fromStack).booleanValue());
  -                    
  +                    callParamRule = new CallParamRule(paramIndex);     
                   }
               } else {
                   if (fromStack == null) {
  -                    
  -                    callParamRule = new CallParamRule( paramIndex, attributeName );
  -                    
  -                    
  +                    callParamRule = new CallParamRule(paramIndex, attributeName);     
              
                   } else {
                       // specifying both from-stack and attribute name is not allowed
  -                    throw new RuntimeException("Attributes from-stack and attrname cannot
both be present.");
  +                    throw new RuntimeException(
  +                        "Attributes from-stack and attrname cannot both be present.");
                   }
               }
               return callParamRule;
  
  
  
  1.15      +4 -3      jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/digester-rules.dtd
  
  Index: digester-rules.dtd
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/java/org/apache/commons/digester/xmlrules/digester-rules.dtd,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- digester-rules.dtd	14 Jan 2005 11:04:31 -0000	1.14
  +++ digester-rules.dtd	18 Jan 2005 00:11:12 -0000	1.15
  @@ -114,7 +114,8 @@
       pattern  CDATA #IMPLIED
       paramnumber CDATA #REQUIRED
       attrname CDATA #IMPLIED
  -    from-stack CDATA #IMPLIED>
  +    from-stack CDATA #IMPLIED
  +    stack-index CDATA #IMPLIED>
       
   <!--
       ObjectParamRule
  
  
  

---------------------------------------------------------------------
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