org.apache.commons.digester3.binder
Class AbstractParamTypeBuilder<R extends AbstractMethodRule>

java.lang.Object
  extended by org.apache.commons.digester3.binder.AbstractParamTypeBuilder<R>
Type Parameters:
R - any AbstractMethodRule concrete implementation, typically SetNextRule, SetRootRule and SetTopRule
All Implemented Interfaces:
RuleProvider<R>
Direct Known Subclasses:
SetNextBuilder, SetRootBuilder, SetTopBuilder

public abstract class AbstractParamTypeBuilder<R extends AbstractMethodRule>
extends Object

Builder chained when invoking LinkedRuleBuilder.setNext(String), LinkedRuleBuilder.setRoot(String) or LinkedRuleBuilder.setTop(String).

Since:
3.0

Method Summary
protected abstract  R createRule()
          Provides an instance of Rule.
 AbstractParamTypeBuilder<R> fireOnBegin(boolean fireOnBegin)
          Marks the rule be invoked when begin or end events match.
 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.
 AbstractParamTypeBuilder<R> useExactMatch(boolean useExactMatch)
          Sets exact matching being used.
 AbstractParamTypeBuilder<R> withParameterType(Class<?> paramType)
          Sets the Java class of the method's argument.
 AbstractParamTypeBuilder<R> withParameterType(String paramType)
          Sets the Java class name of the method's argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withParameterType

public final AbstractParamTypeBuilder<R> withParameterType(Class<?> paramType)
Sets the Java class of the method's argument. If you wish to use a primitive type, specify the corresonding Java wrapper class instead, such as java.lang.Boolean for a boolean parameter.

Parameters:
paramType - The Java class of the method's argument
Returns:
this builder instance

withParameterType

public final AbstractParamTypeBuilder<R> withParameterType(String paramType)
Sets the Java class name of the method's argument. If you wish to use a primitive type, specify the corresonding Java wrapper class instead, such as java.lang.Boolean for a boolean parameter.

Parameters:
paramType - The Java class name of the method's argument
Returns:
this builder instance

useExactMatch

public final AbstractParamTypeBuilder<R> useExactMatch(boolean useExactMatch)
Sets exact matching being used.

Parameters:
useExactMatch - The exact matching being used
Returns:
this builder instance

fireOnBegin

public final AbstractParamTypeBuilder<R> fireOnBegin(boolean fireOnBegin)
Marks the rule be invoked when begin or end events match.

Parameters:
fireOnBegin - true, to invoke the rule at begin, false for end
Returns:
this builder instance

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

createRule

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

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


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