Class ObjectCreateBuilder
java.lang.Object
org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder<ObjectCreateRule>
org.apache.commons.digester3.binder.ObjectCreateBuilder
- All Implemented Interfaces:
RuleProvider<ObjectCreateRule>
Builder chained when invoking
LinkedRuleBuilder.createObject()
.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private final ClassLoader
private Class<?>[]
The constructor argument typesprivate Object[]
Default constructor arguments.private Class
<?> -
Constructor Summary
ConstructorsConstructorDescriptionObjectCreateBuilder
(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, ClassLoader classLoader) -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectCreateRule
Provides an instance ofRule
.Construct an object with the specified class.Construct an object with the specified class name.ofTypeSpecifiedByAttribute
(String attributeName) Allows specify the attribute containing an override class name if it is present.usingConstructor
(Class<?>... constructorArgumentTypes) Allows users to specify constructor argument types.usingConstructor
(String... paramTypeNames) Allows users to specify constructor argument type names.usingDefaultConstructorArguments
(Object... defaultConstructorArguments) Allows users to specify default constructor arguments.Methods inherited from class org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder
get, getNamespaceURI, getPattern, reportError, then
-
Field Details
-
classLoader
-
type
-
attributeName
-
constructorArgumentsType
The constructor argument types- Since:
- 3.2
-
defaultConstructorArguments
Default constructor arguments.- Since:
- 3.2
-
-
Constructor Details
-
ObjectCreateBuilder
ObjectCreateBuilder(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, ClassLoader classLoader)
-
-
Method Details
-
ofType
Construct an object with the specified class name.- Parameters:
className
- Java class name of the object to be created- Returns:
- this builder instance
-
ofType
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
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
Allows users to specify constructor argument type names.- Parameters:
paramTypeNames
- the constructor argument type names- Returns:
- this builder instance
- Since:
- 3.2
-
usingConstructor
Allows users to specify constructor argument types.- Parameters:
constructorArgumentTypes
- the constructor argument types- Returns:
- this builder instance
- Since:
- 3.2
-
usingDefaultConstructorArguments
Allows users to specify default constructor arguments.- Parameters:
defaultConstructorArguments
- the default constructor arguments.- Returns:
- this builder instance
- Since:
- 3.2
-
createRule
Provides an instance ofRule
. Must never return null.- Specified by:
createRule
in classAbstractBackToLinkedRuleBuilder<ObjectCreateRule>
- Returns:
- an instance of
Rule
. - See Also:
-