Class CallMethodBuilder
- java.lang.Object
-
- org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder<CallMethodRule>
-
- org.apache.commons.digester3.binder.CallMethodBuilder
-
- All Implemented Interfaces:
RuleProvider<CallMethodRule>
public final class CallMethodBuilder extends AbstractBackToLinkedRuleBuilder<CallMethodRule>
Builder chained when invokingLinkedRuleBuilder.callMethod(String).- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ClassLoaderclassLoaderprivate java.lang.StringmethodNameprivate intparamCountprivate java.lang.Class<?>[]paramTypesprivate inttargetOffsetprivate booleanuseExactMatch
-
Constructor Summary
Constructors Constructor Description CallMethodBuilder(java.lang.String keyPattern, java.lang.String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, java.lang.String methodName, java.lang.ClassLoader classLoader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CallMethodRulecreateRule()Provides an instance ofRule.CallMethodBuilderuseExactMatch(boolean useExactMatch)ShouldMethodUtils.invokeExactMethodbe used for the reflection.CallMethodBuilderusingElementBodyAsArgument()Prepare theCallMethodRuleto be invoked using the matching element body as argument.CallMethodBuilderwithParamCount(int paramCount)The number of parameters to collect, or zero for a single argument from the body of this element.CallMethodBuilderwithParamTypes(java.lang.Class<?>... paramTypes)Sets the Java classes that represent the parameter types of the method arguments.CallMethodBuilderwithParamTypes(java.lang.String... paramTypeNames)Sets the Java class names that represent the parameter types of the method arguments.CallMethodBuilderwithTargetOffset(int targetOffset)Sets the location of the target object.-
Methods inherited from class org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder
get, getNamespaceURI, getPattern, reportError, then
-
-
-
-
Constructor Detail
-
CallMethodBuilder
CallMethodBuilder(java.lang.String keyPattern, java.lang.String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, java.lang.String methodName, java.lang.ClassLoader classLoader)
-
-
Method Detail
-
withTargetOffset
public CallMethodBuilder withTargetOffset(int targetOffset)
Sets the location of the target object. Positive numbers are relative to the top of the digester object stack. Negative numbers are relative to the bottom of the stack. Zero implies the top object on the stack.- Parameters:
targetOffset- location of the target object.- Returns:
- this builder instance
-
withParamTypes
public CallMethodBuilder withParamTypes(java.lang.String... paramTypeNames)
Sets the Java class names that represent the parameter types of the method arguments. If you wish to use a primitive type, specify the corresonding Java wrapper class instead, such asjava.lang.Boolean.TYPEfor abooleanparameter.- Parameters:
paramTypeNames- The Java classes names that represent the parameter types of the method arguments- Returns:
- this builder instance
-
withParamTypes
public CallMethodBuilder withParamTypes(java.lang.Class<?>... paramTypes)
Sets the Java classes that represent the parameter types of the method arguments. If you wish to use a primitive type, specify the corresonding Java wrapper class instead, such asjava.lang.Boolean.TYPEfor abooleanparameter.- Parameters:
paramTypes- The Java classes that represent the parameter types of the method arguments- Returns:
- this builder instance
-
useExactMatch
public CallMethodBuilder useExactMatch(boolean useExactMatch)
ShouldMethodUtils.invokeExactMethodbe used for the reflection.- Parameters:
useExactMatch- Flag to mark exact matching or not- Returns:
- this builder instance
-
withParamCount
public CallMethodBuilder withParamCount(int paramCount)
The number of parameters to collect, or zero for a single argument from the body of this element.- Parameters:
paramCount- The number of parameters to collect, or zero for a single argument from the body of this element.- Returns:
- this builder instance
-
usingElementBodyAsArgument
public CallMethodBuilder usingElementBodyAsArgument()
Prepare theCallMethodRuleto be invoked using the matching element body as argument.- Returns:
- this builder instance
-
createRule
protected CallMethodRule createRule()
Provides an instance ofRule. Must never return null.- Specified by:
createRulein classAbstractBackToLinkedRuleBuilder<CallMethodRule>- Returns:
- an instance of
Rule. - See Also:
AbstractBackToLinkedRuleBuilder.get()
-
-