You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2011/05/14 17:23:37 UTC

svn commit: r1103134 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java

Author: simonetripodi
Date: Sat May 14 15:23:36 2011
New Revision: 1103134

URL: http://svn.apache.org/viewvc?rev=1103134&view=rev
Log:
linked CallMethodBuilder via callMethod(String) method

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

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java?rev=1103134&r1=1103133&r2=1103134&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/binder/LinkedRuleBuilder.java Sat May 14 15:23:36 2011
@@ -56,6 +56,24 @@ public final class LinkedRuleBuilder
     }
 
     /**
+     * Calls a method on an object on the stack (normally the top/parent object), passing arguments collected from
+     * subsequent {@link #callParam(int)} rule or from the body of this element.
+     *
+     * @param methodName Method name of the parent object to call
+     */
+    public CallMethodBuilder callMethod( String methodName )
+    {
+        if ( methodName == null || methodName.length() == 0 )
+        {
+            mainBinder.addError( "{ forPattern( \"%s\" ).callMethod( String ) } empty 'methodName' not allowed",
+                                 keyPattern );
+        }
+
+        return this.addProvider( new CallMethodBuilder( keyPattern, namespaceURI, mainBinder, this, methodName,
+                                                        classLoader ) );
+    }
+
+    /**
      * Sets the namespace URI for the current rule pattern.
      *
      * @param namespaceURI the namespace URI associated to the rule pattern.