Class FactoryCreateBuilder
java.lang.Object
org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder<FactoryCreateRule>
org.apache.commons.digester3.binder.FactoryCreateBuilder
- All Implemented Interfaces:
RuleProvider<FactoryCreateRule>
Builder chained when invoking
LinkedRuleBuilder.factoryCreate()
.- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private final ClassLoader
private ObjectCreationFactory
<?> private boolean
private Class
<? extends ObjectCreationFactory<?>> -
Constructor Summary
ConstructorsConstructorDescriptionFactoryCreateBuilder
(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, ClassLoader classLoader) -
Method Summary
Modifier and TypeMethodDescriptionprotected FactoryCreateRule
Provides an instance ofRule
.ignoreCreateExceptions
(boolean ignoreCreateExceptions) Exceptions thrown by the object creation factory will be ignored or not.ofType
(Class<? extends ObjectCreationFactory<?>> type) Construct a factory create rule that will use the specified class to create anObjectCreationFactory
which will then be used to create an object and push it on the stack.Construct a factory create rule that will use the specified class name to create anObjectCreationFactory
which will then be used to create an object and push it on the stack.overriddenByAttribute
(String attributeName) Allows specify the attribute containing an override class name if it is present.usingFactory
(ObjectCreationFactory<T> creationFactory) Construct a factory create rule using the given, already instantiated,ObjectCreationFactory
.Methods inherited from class org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder
get, getNamespaceURI, getPattern, reportError, then
-
Field Details
-
classLoader
-
type
-
attributeName
-
ignoreCreateExceptions
private boolean ignoreCreateExceptions -
creationFactory
-
-
Constructor Details
-
FactoryCreateBuilder
FactoryCreateBuilder(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder, ClassLoader classLoader)
-
-
Method Details
-
ofType
Construct a factory create rule that will use the specified class name to create anObjectCreationFactory
which will then be used to create an object and push it on the stack.- Parameters:
className
- Java class name of the object creation factory class- Returns:
- this builder instance
-
ofType
Construct a factory create rule that will use the specified class to create anObjectCreationFactory
which will then be used to create an object and push it on the stack.- Parameters:
type
- Java class of the object creation factory class- Returns:
- this builder instance
-
usingFactory
Construct a factory create rule using the given, already instantiated,ObjectCreationFactory
.- Type Parameters:
T
- the type of created object by the given factory- Parameters:
creationFactory
- called on to create the object- Returns:
- this builder instance
-
overriddenByAttribute
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
-
ignoreCreateExceptions
Exceptions thrown by the object creation factory will be ignored or not.- Parameters:
ignoreCreateExceptions
- if true, exceptions thrown by the object creation factory will be ignored- Returns:
- this builder instance
-
createRule
Provides an instance ofRule
. Must never return null.- Specified by:
createRule
in classAbstractBackToLinkedRuleBuilder<FactoryCreateRule>
- Returns:
- an instance of
Rule
. - See Also:
-