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/02/13 02:22:06 UTC
svn commit: r1070172 -
/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/handlers/CallParamHandler.java
Author: simonetripodi
Date: Sun Feb 13 01:22:06 2011
New Revision: 1070172
URL: http://svn.apache.org/viewvc?rev=1070172&view=rev
Log:
fixed parameterIndex/stackIndex misunderstanding
Modified:
commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/handlers/CallParamHandler.java
Modified: commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/handlers/CallParamHandler.java
URL: http://svn.apache.org/viewvc/commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/handlers/CallParamHandler.java?rev=1070172&r1=1070171&r2=1070172&view=diff
==============================================================================
--- commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/handlers/CallParamHandler.java (original)
+++ commons/sandbox/digester3/trunk/src/main/java/org/apache/commons/digester3/annotations/handlers/CallParamHandler.java Sun Feb 13 01:22:06 2011
@@ -21,6 +21,7 @@ import org.apache.commons.digester3.Rule
import org.apache.commons.digester3.annotations.AnnotationHandler;
import org.apache.commons.digester3.annotations.reflect.MethodArgument;
import org.apache.commons.digester3.annotations.rules.CallParam;
+import org.apache.commons.digester3.rulesbinder.CallParamBuilder;
/**
* {@link CallParam} handler.
@@ -31,13 +32,14 @@ public final class CallParamHandler impl
* {@inheritDoc}
*/
public void handle(CallParam annotation, MethodArgument element, RulesBinder rulesBinder) {
- rulesBinder.forPattern(annotation.pattern())
+ CallParamBuilder builder = rulesBinder.forPattern(annotation.pattern())
.withNamespaceURI(annotation.namespaceURI())
.callParam()
.ofIndex(element.getIndex())
- .fromAttribute(annotation.attributeName().length() > 0 ? annotation.attributeName() : null)
- .fromStack(annotation.fromStack())
- .ofIndex(annotation.stackIndex());
+ .fromAttribute(annotation.attributeName().length() > 0 ? annotation.attributeName() : null);
+ if (annotation.fromStack()) {
+ builder.withStackIndex(annotation.stackIndex());
+ }
}
}