Class PluginCreateRuleBuilder
- java.lang.Object
-
- org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder<PluginCreateRule>
-
- org.apache.commons.digester3.binder.PluginCreateRuleBuilder
-
- All Implemented Interfaces:
RuleProvider<PluginCreateRule>
public final class PluginCreateRuleBuilder extends AbstractBackToLinkedRuleBuilder<PluginCreateRule>
Builder chained when invokingLinkedRuleBuilder.createPlugin()
.- Since:
- 3.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Class<?>
baseClass
private java.lang.Class<?>
dfltPluginClass
private RuleLoader
dfltPluginRuleLoader
private java.util.Map<java.lang.String,java.lang.String>
pluginClassAttributes
private java.util.Map<java.lang.String,java.lang.String>
pluginIdAttributes
-
Constructor Summary
Constructors Constructor Description PluginCreateRuleBuilder(java.lang.String keyPattern, java.lang.String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private PluginCreateRuleBuilder
addToMap(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String namespaceUri, java.lang.String attrName)
Private internal method to set values to aMap
instance and return the current builder.protected PluginCreateRule
createRule()
Provides an instance ofRule
.<T> PluginCreateRuleBuilder
ofType(java.lang.Class<T> type)
Set the class which any specified plugin must be descended from.PluginCreateRuleBuilder
setPluginClassAttribute(java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.PluginCreateRuleBuilder
setPluginClassAttribute(java.lang.String namespaceUri, java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.PluginCreateRuleBuilder
setPluginIdAttribute(java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.PluginCreateRuleBuilder
setPluginIdAttribute(java.lang.String namespaceUri, java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.<T> PluginCreateRuleBuilder
usingDefaultPluginClass(java.lang.Class<T> type)
Set the class which will be used if the user doesn't specify any plugin-class or plugin-id.<RL extends RuleLoader>
PluginCreateRuleBuilderusingRuleLoader(RL ruleLoader)
Set RuleLoader instance which knows how to load the custom rules associated with the default plugin.-
Methods inherited from class org.apache.commons.digester3.binder.AbstractBackToLinkedRuleBuilder
get, getNamespaceURI, getPattern, reportError, then
-
-
-
-
Field Detail
-
pluginClassAttributes
private final java.util.Map<java.lang.String,java.lang.String> pluginClassAttributes
-
pluginIdAttributes
private final java.util.Map<java.lang.String,java.lang.String> pluginIdAttributes
-
baseClass
private java.lang.Class<?> baseClass
-
dfltPluginClass
private java.lang.Class<?> dfltPluginClass
-
dfltPluginRuleLoader
private RuleLoader dfltPluginRuleLoader
-
-
Constructor Detail
-
PluginCreateRuleBuilder
PluginCreateRuleBuilder(java.lang.String keyPattern, java.lang.String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder)
-
-
Method Detail
-
ofType
public <T> PluginCreateRuleBuilder ofType(java.lang.Class<T> type)
Set the class which any specified plugin must be descended from.- Type Parameters:
T
- Any Java type- Parameters:
type
- the class which any specified plugin must be descended from- Returns:
- this builder instance
-
usingDefaultPluginClass
public <T> PluginCreateRuleBuilder usingDefaultPluginClass(java.lang.Class<T> type)
Set the class which will be used if the user doesn't specify any plugin-class or plugin-id.- Type Parameters:
T
- Any Java type- Parameters:
type
- the class which will be used if the user doesn't specify any plugin-class or plugin-id.- Returns:
- this builder instance
-
usingRuleLoader
public <RL extends RuleLoader> PluginCreateRuleBuilder usingRuleLoader(RL ruleLoader)
Set RuleLoader instance which knows how to load the custom rules associated with the default plugin.- Type Parameters:
RL
- AnyRuleLoader
extension.- Parameters:
ruleLoader
- the RuleLoader instance which knows how to load the custom rules associated with the default plugin.- Returns:
- this builder instance
-
setPluginClassAttribute
public PluginCreateRuleBuilder setPluginClassAttribute(java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.- Parameters:
attrName
- the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.- Returns:
- this builder instance
-
setPluginClassAttribute
public PluginCreateRuleBuilder setPluginClassAttribute(java.lang.String namespaceUri, java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.- Parameters:
namespaceUri
- The attribute NameSpaceattrName
- The attribute name- Returns:
- this builder instance
-
setPluginIdAttribute
public PluginCreateRuleBuilder setPluginIdAttribute(java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.- Parameters:
attrName
- The attribute name- Returns:
- this builder instance
-
setPluginIdAttribute
public PluginCreateRuleBuilder setPluginIdAttribute(java.lang.String namespaceUri, java.lang.String attrName)
Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.- Parameters:
namespaceUri
- The attribute NameSpaceattrName
- The attribute name- Returns:
- this builder instance
-
addToMap
private PluginCreateRuleBuilder addToMap(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String namespaceUri, java.lang.String attrName)
Private internal method to set values to aMap
instance and return the current builder.- Parameters:
map
- The targetMap
namespaceUri
- The attribute NameSpaceattrName
- The attribute name- Returns:
- this builder instance
-
createRule
protected PluginCreateRule createRule()
Provides an instance ofRule
. Must never return null.- Specified by:
createRule
in classAbstractBackToLinkedRuleBuilder<PluginCreateRule>
- Returns:
- an instance of
Rule
. - See Also:
AbstractBackToLinkedRuleBuilder.get()
-
-