Class ObjectCreateBuilder
- java.lang.Object
-
- org.apache.commons.digester3.binder.ObjectCreateBuilder
-
- All Implemented Interfaces:
RuleProvider<ObjectCreateRule>
public final class ObjectCreateBuilder extends java.lang.Object
Builder chained when invokingLinkedRuleBuilder.createObject().- Since:
- 3.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectCreateRulecreateRule()Provides an instance ofRule.Rget()Provides an instance ofRule.java.lang.StringgetNamespaceURI()Returns the namespace URI for which this Rule is relevant, if any.java.lang.StringgetPattern()Returns the rule pattern associated to this builder.<T> ObjectCreateBuilderofType(java.lang.Class<T> type)Construct an object with the specified class.ObjectCreateBuilderofType(java.lang.String className)Construct an object with the specified class name.ObjectCreateBuilderofTypeSpecifiedByAttribute(java.lang.String attributeName)Allows specify the attribute containing an override class name if it is present.protected voidreportError(java.lang.String methodChain, java.lang.String message)LinkedRuleBuilderthen()Come back to the mainLinkedRuleBuilder.ObjectCreateBuilderusingConstructor(java.lang.Class<?>... constructorArgumentTypes)Allows users to specify constructor argument types.ObjectCreateBuilderusingConstructor(java.lang.String... paramTypeNames)Allows users to specify constructor argument type names.ObjectCreateBuilderusingDefaultConstructorArguments(java.lang.Object... defaultConstructorArguments)Allows users to specify default constructor arguments.
-
-
-
Method Detail
-
ofType
public ObjectCreateBuilder ofType(java.lang.String className)
Construct an object with the specified class name.- Parameters:
className- Java class name of the object to be created- Returns:
- this builder instance
-
ofType
public <T> ObjectCreateBuilder ofType(java.lang.Class<T> type)
Construct an object with the specified class.- Type Parameters:
T- any java type- Parameters:
type- Java class of the object to be created- Returns:
- this builder instance
-
ofTypeSpecifiedByAttribute
public ObjectCreateBuilder ofTypeSpecifiedByAttribute(java.lang.String attributeName)
Allows specify the attribute containing an override class name if it is present.- Parameters:
attributeName- The attribute containing an override class name if it is present- Returns:
- this builder instance
-
usingConstructor
public ObjectCreateBuilder usingConstructor(java.lang.String... paramTypeNames)
Allows users to specify constructor argument type names.- Parameters:
paramTypeNames- the constructor argument type names- Returns:
- this builder instance
- Since:
- 3.2
-
usingConstructor
public ObjectCreateBuilder usingConstructor(java.lang.Class<?>... constructorArgumentTypes)
Allows users to specify constructor argument types.- Parameters:
constructorArgumentTypes- the constructor argument types- Returns:
- this builder instance
- Since:
- 3.2
-
usingDefaultConstructorArguments
public ObjectCreateBuilder usingDefaultConstructorArguments(java.lang.Object... defaultConstructorArguments)
Allows users to specify default constructor arguments.- Parameters:
defaultConstructorArguments- the default constructor arguments.- Returns:
- this builder instance
- Since:
- 3.2
-
createRule
protected ObjectCreateRule createRule()
Provides an instance ofRule. Must never return null.- Returns:
- an instance of
Rule. - See Also:
RuleProvider.get()
-
then
public final LinkedRuleBuilder then()
Come back to the mainLinkedRuleBuilder.- Returns:
- the main
LinkedRuleBuilder
-
getNamespaceURI
public final java.lang.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 ofRule. Must never return null.- Specified by:
getin interfaceRuleProvider<R extends Rule>- Returns:
- an instance of
Rule.
-
reportError
protected final void reportError(java.lang.String methodChain, java.lang.String message)
-
getPattern
public final java.lang.String getPattern()
Returns the rule pattern associated to this builder.- Returns:
- The rule pattern associated to this builder
-
-