Class CallMethodBuilder
java.lang.Object
org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder<CallMethodRule>
org.apache.commons.digester3.binder.CallMethodBuilder
- All Implemented Interfaces:
RuleProvider<CallMethodRule>
Builder chained when invoking
LinkedRuleBuilder.callMethod(String)
.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassLoader
private final String
private int
private Class<?>[]
private int
private boolean
-
Constructor Summary
ConstructorsConstructorDescriptionCallMethodBuilder
(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, String methodName, ClassLoader classLoader) -
Method Summary
Modifier and TypeMethodDescriptionprotected CallMethodRule
Provides an instance ofRule
.useExactMatch
(boolean useExactMatch) ShouldMethodUtils.invokeExactMethod
be used for the reflection.Prepare theCallMethodRule
to be invoked using the matching element body as argument.withParamCount
(int paramCount) The number of parameters to collect, or zero for a single argument from the body of this element.withParamTypes
(Class<?>... paramTypes) Sets the Java classes that represent the parameter types of the method arguments.withParamTypes
(String... paramTypeNames) Sets the Java class names that represent the parameter types of the method arguments.withTargetOffset
(int targetOffset) Sets the location of the target object.Methods inherited from class org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder
get, getNamespaceURI, getPattern, reportError, then
-
Field Details
-
methodName
-
classLoader
-
targetOffset
private int targetOffset -
paramCount
private int paramCount -
paramTypes
-
useExactMatch
private boolean useExactMatch
-
-
Constructor Details
-
CallMethodBuilder
CallMethodBuilder(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, String methodName, ClassLoader classLoader)
-
-
Method Details
-
withTargetOffset
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
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.TYPE
for aboolean
parameter.- Parameters:
paramTypeNames
- The Java classes names that represent the parameter types of the method arguments- Returns:
- this builder instance
-
withParamTypes
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.TYPE
for aboolean
parameter.- Parameters:
paramTypes
- The Java classes that represent the parameter types of the method arguments- Returns:
- this builder instance
-
useExactMatch
ShouldMethodUtils.invokeExactMethod
be used for the reflection.- Parameters:
useExactMatch
- Flag to mark exact matching or not- Returns:
- this builder instance
-
withParamCount
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
Prepare theCallMethodRule
to be invoked using the matching element body as argument.- Returns:
- this builder instance
-
createRule
Provides an instance ofRule
. Must never return null.- Specified by:
createRule
in classAbstractBackToLinkedRuleBuilder<CallMethodRule>
- Returns:
- an instance of
Rule
. - See Also:
-