org.apache.commons.digester3.binder
Class FactoryCreateBuilder

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

public final class FactoryCreateBuilder
extends Object

Builder chained when invoking LinkedRuleBuilder.factoryCreate().

Since:
3.0

Method Summary
protected  FactoryCreateRule 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.
 FactoryCreateBuilder ignoreCreateExceptions(boolean ignoreCreateExceptions)
          Exceptions thrown by the object creation factory will be ignored or not.
 FactoryCreateBuilder ofType(Class<? extends ObjectCreationFactory<?>> type)
          Construct a factory create rule that will use the specified class to create an ObjectCreationFactory which will then be used to create an object and push it on the stack.
 FactoryCreateBuilder ofType(String className)
          Construct a factory create rule that will use the specified class name to create an ObjectCreationFactory which will then be used to create an object and push it on the stack.
 FactoryCreateBuilder overriddenByAttribute(String attributeName)
          Allows specify the attribute containing an override class name if it is present.
protected  void reportError(String methodChain, String message)
           
 LinkedRuleBuilder then()
          Come back to the main LinkedRuleBuilder.
<T> FactoryCreateBuilder
usingFactory(ObjectCreationFactory<T> creationFactory)
          Construct a factory create rule using the given, already instantiated, ObjectCreationFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

ofType

public FactoryCreateBuilder ofType(String className)
Construct a factory create rule that will use the specified class name to create an ObjectCreationFactory 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

public FactoryCreateBuilder ofType(Class<? extends ObjectCreationFactory<?>> type)
Construct a factory create rule that will use the specified class to create an ObjectCreationFactory 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

public <T> FactoryCreateBuilder usingFactory(ObjectCreationFactory<T> creationFactory)
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

public FactoryCreateBuilder overriddenByAttribute(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

ignoreCreateExceptions

public FactoryCreateBuilder ignoreCreateExceptions(boolean 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

protected FactoryCreateRule 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.