Class AbstractRulesImpl
java.lang.Object
org.apache.commons.digester3.AbstractRulesImpl
- All Implemented Interfaces:
Rules
- Direct Known Subclasses:
RegexRules, RulesBase
AbstractRuleImpl provides basic services for Rules implementations. Extending this class
should make it easier to create a Rules implementation.
AbstractRuleImpl manages the Digester and namespaceUri properties. If the
subclass overrides registerRule(String, Rule) (rather than add(String, Rule)), then the Digester and
namespaceURI of the Rule will be set correctly before it is passed to
registerRule. The subclass can then perform whatever it needs to do to register the rule.
- Since:
- 1.5
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidRegister a new Rule instance matching the specified pattern.Return the Digester instance with which this Rules instance is associated.Return the namespace URI that will be applied to all subsequently addedRuleobjects.protected abstract voidregisterRule(String pattern, Rule rule) Register rule at given pattern.voidsetDigester(Digester digester) Set the Digester instance with which this Rules instance is associated.voidsetNamespaceURI(String namespaceURI) Set the namespace URI that will be applied to all subsequently addedRuleobjects.
-
Constructor Details
-
AbstractRulesImpl
public AbstractRulesImpl()
-
-
Method Details
-
getDigester
Return the Digester instance with which this Rules instance is associated.- Specified by:
getDigesterin interfaceRules- Returns:
- the Digester instance with which this Rules instance is associated
-
setDigester
Set the Digester instance with which this Rules instance is associated.- Specified by:
setDigesterin interfaceRules- Parameters:
digester- The newly associated Digester instance
-
getNamespaceURI
Return the namespace URI that will be applied to all subsequently addedRuleobjects.- Specified by:
getNamespaceURIin interfaceRules- Returns:
- the namespace URI that will be applied to all subsequently added
Ruleobjects.
-
setNamespaceURI
Set the namespace URI that will be applied to all subsequently addedRuleobjects.- Specified by:
setNamespaceURIin interfaceRules- Parameters:
namespaceURI- Namespace URI that must match on all subsequently added rules, ornullfor matching regardless of the current namespace URI
-
add
-
registerRule
Register rule at given pattern. The the Digester and namespaceURI properties of the givenRulecan be assumed to have been set properly before this method is called.- Parameters:
pattern- Nesting pattern to be matched for this Rulerule- Rule instance to be registered
-