commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1066079 - /commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Date Tue, 01 Feb 2011 16:11:17 GMT
Author: simonetripodi
Date: Tue Feb  1 16:11:16 2011
New Revision: 1066079

URL: http://svn.apache.org/viewvc?rev=1066079&view=rev
Log:
added callParam() method implementation

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

Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java?rev=1066079&r1=1066078&r2=1066079&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
(original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/RulesBinderImpl.java
Tue Feb  1 16:11:16 2011
@@ -532,8 +532,54 @@ final class RulesBinderImpl implements R
                 });
             }
 
+            /**
+             * 
+             */
             public CallParamBuilder callParam() {
-                return null;
+                return this.addProvider(new CallParamBuilder() {
+
+                    private int paramIndex = 0;
+
+                    private int stackIndex = 0;
+
+                    private boolean fromStack = false;
+
+                    private String attributeName;
+
+                    public CallParamRule get() {
+                        return setNamespaceAndReturn(new CallParamRule(paramIndex, fromStack,
stackIndex, attributeName));
+                    }
+
+                    public LinkedRuleBuilder then() {
+                        return mainBuilder;
+                    }
+
+                    public CallParamBuilder withStackIndex(int stackIndex) {
+                        this.stackIndex = stackIndex;
+                        return this;
+                    }
+
+                    public CallParamBuilder ofIndex(int paramIndex) {
+                        if (paramIndex < 0) {
+                            addError("{forPattern(\"%s\").callParam().ofIndex(int)} negative
index argument not allowed",
+                                    keyPattern);
+                        }
+
+                        this.paramIndex = paramIndex;
+                        return this;
+                    }
+
+                    public CallParamBuilder fromStack(boolean fromStack) {
+                        this.fromStack = fromStack;
+                        return this;
+                    }
+
+                    public CallParamBuilder fromAttribute(/* @Nullable */String attributeName)
{
+                        this.attributeName = attributeName;
+                        return this;
+                    }
+
+                });
             }
 
             public CallMethodBuilder callMethod(String methodName) {



Mime
View raw message