Class AbstractRulesImpl
java.lang.Object
org.apache.commons.digester.AbstractRulesImpl
- All Implemented Interfaces:
Rules
- Direct Known Subclasses:
RegexRules
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a new Rule instance matching the specified pattern.abstract voidclear()Clear all existing Rule instance registrations.Return the Digester instance with which this Rules instance is associated.Return the namespace URI that will be applied to all subsequently addedRuleobjects.Deprecated.Call match(namespaceURI,pattern) instead.Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches.protected abstract voidregisterRule(String pattern, Rule rule) Register rule at given pattern.rules()Return a List of all registered Rule instances, or a zero-length List if there are no registered Rule instances.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.
-
Field Details
-
digester
Digester using thisRulesimplementation -
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:
getDigesterin interfaceRules
-
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
-
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
Registers a new Rule instance matching the specified pattern. This implementation sets theDigesterand thenamespaceURIon theRulebefore callingregisterRule(String, Rule). -
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
-
clear
-
match
Deprecated.Call match(namespaceURI,pattern) instead.Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches. If more than one Rule instance matches, they must be returned in the order originally registered through theadd()method. -
match
Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches. If more than one Rule instance matches, they must be returned in the order originally registered through theadd()method. -
rules
Return a List of all registered Rule instances, or a zero-length List if there are no registered Rule instances. If more than one Rule instance has been registered, they must be returned in the order originally registered through theadd()method.
-