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 invoking
LinkedRuleBuilder.createPlugin()
.- Since:
- 3.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPluginCreateRuleBuilder
(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder) -
Method Summary
Modifier and TypeMethodDescriptionprivate PluginCreateRuleBuilder
Private internal method to set values to aMap
instance and return the current builder.protected PluginCreateRule
Provides an instance ofRule
.Set the class which any specified plugin must be descended from.setPluginClassAttribute
(String attrName) Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.setPluginClassAttribute
(String namespaceUri, String attrName) Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.setPluginIdAttribute
(String attrName) Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.setPluginIdAttribute
(String namespaceUri, String attrName) Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.usingDefaultPluginClass
(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 Details
-
pluginClassAttributes
-
pluginIdAttributes
-
baseClass
-
dfltPluginClass
-
dfltPluginRuleLoader
-
-
Constructor Details
-
PluginCreateRuleBuilder
PluginCreateRuleBuilder(String keyPattern, String namespaceURI, RulesBinder mainBinder, LinkedRuleBuilder mainBuilder)
-
-
Method Details
-
ofType
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
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
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
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
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
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
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(Map<String, String> map, String namespaceUri, 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
Provides an instance ofRule
. Must never return null.- Specified by:
createRule
in classAbstractBackToLinkedRuleBuilder<PluginCreateRule>
- Returns:
- an instance of
Rule
. - See Also:
-