commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r153393 - jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/factory/ActionFactory.java
Date Fri, 11 Feb 2005 12:25:33 GMT
Author: skitching
Date: Fri Feb 11 04:25:31 2005
New Revision: 153393

URL: http://svn.apache.org/viewcvs?view=rev&rev=153393
Log:
Updates due to changes in CallMethodAction and the CallParam actions.

Modified:
    jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/factory/ActionFactory.java

Modified: jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/factory/ActionFactory.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/factory/ActionFactory.java?view=diff&r1=153392&r2=153393
==============================================================================
--- jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/factory/ActionFactory.java
(original)
+++ jakarta/commons/proper/digester/branches/digester2/src/java/org/apache/commons/digester2/factory/ActionFactory.java
Fri Feb 11 04:25:31 2005
@@ -261,7 +261,7 @@
      */
     public Action addCallMethod(String pattern, String methodName)
     throws InvalidRuleException {
-        Action action = new CallMethodAction(methodName); 
+        Action action = new CallMethodAction(methodName, 0); 
         return addRule(pattern, action);
     }
 
@@ -280,18 +280,12 @@
         return addRule(pattern, action);
     }
 
-
     /**
      * Add an "call method" rule for the specified parameters.
-     * If <code>paramCount</code> is set to zero the rule will use
-     * the body of the matched element as the single argument of the
-     * method, unless <code>paramTypes</code> is null or empty, in this
-     * case the rule will call the specified method with no arguments.
      *
      * @param pattern Element matching pattern
      * @param methodName Method name to be called
-     * @param paramCount Number of expected parameters (or zero
-     *  for a single parameter from the body of this element)
+     * @param paramCount Number of expected parameters.
      * @param paramTypes Set of Java class names for the types
      *  of the expected parameters
      *  (if you wish to use a primitive type, specify the corresonding
@@ -310,10 +304,6 @@
 
     /**
      * Add an "call method" rule for the specified parameters.
-     * If <code>paramCount</code> is set to zero the rule will use
-     * the body of the matched element as the single argument of the
-     * method, unless <code>paramTypes</code> is null or empty, in this
-     * case the rule will call the specified method with no arguments.
      *
      * @param pattern Element matching pattern
      * @param methodName Method name to be called
@@ -338,69 +328,47 @@
     }
 
     /**
-     * Add a "call parameter" rule for the specified parameters.
+     * Set a call parameter from the body of the matched element.
      *
      * @param pattern Element matching pattern
      * @param paramIndex Zero-relative parameter index to set
-     *  (from the body of this element)
      * @see CallParamAction
      */
-    public Action addCallParam(String pattern, int paramIndex)
+    public Action addCallParamBody(String pattern, int paramIndex)
     throws InvalidRuleException {
-        Action action = new CallParamAction(paramIndex);
+        Action action = new CallParamBodyAction(paramIndex);
         return addRule(pattern, action);
     }
 
     /**
-     * Add a "call parameter" rule for the specified parameters.
+     * Set a call parameter from an xml attribute of the matched element.
      *
      * @param pattern Element matching pattern
      * @param paramIndex Zero-relative parameter index to set
-     *  (from the specified attribute)
-     * @param attributeName Attribute whose value is used as the
-     *  parameter value
+     * @param attributeName Attribute whose value is used.
      * @see CallParamAction
      */
-    public void addCallParam(
+    public void addCallParamAttribute(
     String pattern, 
     int paramIndex, 
     String attributeName)
     throws InvalidRuleException {
         addRule(pattern,
-                new CallParamAction(paramIndex, attributeName));
-    }
-
-
-    /**
-     * Add a "call parameter" rule.
-     * This will either take a parameter from the stack 
-     * or from the current element body text. 
-     *
-     * @param paramIndex The zero-relative parameter number
-     * @param fromStack Should the call parameter be taken from the top of the stack?
-     * @see CallParamAction
-     */    
-    public void addCallParam(
-    String pattern, 
-    int paramIndex, 
-    boolean fromStack)
-    throws InvalidRuleException {
-        addRule(pattern,
-                new CallParamAction(paramIndex, fromStack));
+                new CallParamAttributeAction(paramIndex, attributeName));
     }
 
     /**
-     * Add a "call parameter" rule that sets a parameter from the stack.
-     * This takes a parameter from the given position on the stack.
+     * Set a call parameter from an object on the digester object stack.
      *
      * @param paramIndex The zero-relative parameter number
-     * @param stackIndex set the call parameter to the stackIndex'th object down the stack,
-     * where 0 is the top of the stack, 1 the next element down and so on
+     * @param stackIndex set the call parameter to the stackIndex'th object
+     * down the stack, where 0 is the top of the stack, 1 the next element 
+     * down and so on
      * @see CallMethodAction
      */    
-    public void addCallParam(String pattern, int paramIndex, int stackIndex)
+    public void addCallParamFromStack(String pattern, int paramIndex, int stackIndex)
     throws InvalidRuleException {
          addRule(pattern,
-                new CallParamAction(paramIndex, stackIndex));
+                new CallParamFromStackAction(paramIndex, stackIndex));
     }
 }



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