org.apache.commons.digester3.binder
Class CallMethodBuilder

java.lang.Object
  extended by org.apache.commons.digester3.binder.CallMethodBuilder
All Implemented Interfaces:
RuleProvider<CallMethodRule>

public final class CallMethodBuilder
extends Object

Builder chained when invoking LinkedRuleBuilder.callMethod(String).

Since:
3.0

Method Summary
protected  CallMethodRule createRule()
          Provides an instance of Rule.
 R get()
          Provides an instance of Rule.
 String getNamespaceURI()
          Returns the namespace URI for which this Rule is relevant, if any.
 String getPattern()
          Returns the rule pattern associated to this builder.
protected  void reportError(String methodChain, String message)
           
 LinkedRuleBuilder then()
          Come back to the main LinkedRuleBuilder.
 CallMethodBuilder useExactMatch(boolean useExactMatch)
          Should MethodUtils.invokeExactMethod be used for the reflection.
 CallMethodBuilder usingElementBodyAsArgument()
          Prepare the CallMethodRule to be invoked using the matching element body as argument.
 CallMethodBuilder withParamCount(int paramCount)
          The number of parameters to collect, or zero for a single argument from the body of this element.
 CallMethodBuilder withParamTypes(Class<?>... paramTypes)
          Sets the Java classes that represent the parameter types of the method arguments.
 CallMethodBuilder withParamTypes(String... paramTypeNames)
          Sets the Java class names that represent the parameter types of the method arguments.
 CallMethodBuilder withTargetOffset(int targetOffset)
          Sets the location of the target object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(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 as java.lang.Boolean.TYPE for a boolean parameter.

Parameters:
paramTypeNames - The Java classes names that represent the parameter types of the method arguments
Returns:
this builder instance

withParamTypes

public CallMethodBuilder withParamTypes(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 as java.lang.Boolean.TYPE for a boolean parameter.

Parameters:
paramTypes - The Java classes that represent the parameter types of the method arguments
Returns:
this builder instance

useExactMatch

public CallMethodBuilder useExactMatch(boolean useExactMatch)
Should MethodUtils.invokeExactMethod be 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 the CallMethodRule to be invoked using the matching element body as argument.

Returns:
this builder instance

createRule

protected CallMethodRule createRule()
Provides an instance of Rule. Must never return null.

Returns:
an instance of Rule.
See Also:
get()

then

public final LinkedRuleBuilder then()
Come back to the main LinkedRuleBuilder.

Returns:
the main LinkedRuleBuilder

getNamespaceURI

public final String getNamespaceURI()
Returns the namespace URI for which this Rule is relevant, if any.

Returns:
The namespace URI for which this Rule is relevant, if any

get

public final R get()
Provides an instance of Rule. Must never return null.

Specified by:
get in interface RuleProvider<R extends Rule>
Returns:
an instance of Rule.

reportError

protected final void reportError(String methodChain,
                                 String message)

getPattern

public final String getPattern()
Returns the rule pattern associated to this builder.

Returns:
The rule pattern associated to this builder


Copyright © 2001-2011 The Apache Software Foundation. All Rights Reserved.