Package org.apache.commons.digester3
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(java.lang.String, org.apache.commons.digester3.Rule)
(rather than add(java.lang.String, org.apache.commons.digester3.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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Register 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 addedRule
objects.protected abstract void
registerRule
(String pattern, Rule rule) Register rule at given pattern.void
setDigester
(Digester digester) Set the Digester instance with which this Rules instance is associated.void
setNamespaceURI
(String namespaceURI) Set the namespace URI that will be applied to all subsequently addedRule
objects.
-
Field Details
-
digester
Digester using thisRules
implementation -
namespaceURI
Namespace uri to assoicate with subsequentRule
's
-
-
Constructor Details
-
AbstractRulesImpl
public AbstractRulesImpl()
-
-
Method Details
-
getDigester
Return the Digester instance with which this Rules instance is associated.- Specified by:
getDigester
in 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:
setDigester
in interfaceRules
- Parameters:
digester
- The newly associated Digester instance
-
getNamespaceURI
Return the namespace URI that will be applied to all subsequently addedRule
objects.- Specified by:
getNamespaceURI
in interfaceRules
- Returns:
- the namespace URI that will be applied to all subsequently added
Rule
objects.
-
setNamespaceURI
Set the namespace URI that will be applied to all subsequently addedRule
objects.- Specified by:
setNamespaceURI
in interfaceRules
- Parameters:
namespaceURI
- Namespace URI that must match on all subsequently added rules, ornull
for matching regardless of the current namespace URI
-
add
Register a new Rule instance matching the specified pattern. -
registerRule
Register rule at given pattern. The the Digester and namespaceURI properties of the givenRule
can 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
-