Package org.apache.commons.digester
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(java.lang.String, org.apache.commons.digester.Rule)
(rather than add(java.lang.String, org.apache.commons.digester.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 TypeMethodDescriptionvoid
Registers a new Rule instance matching the specified pattern.abstract void
clear()
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 addedRule
objects.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 void
registerRule
(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.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.
-
Constructor Details
-
AbstractRulesImpl
public AbstractRulesImpl()
-
-
Method Details
-
getDigester
Return the Digester instance with which this Rules instance is associated.- Specified by:
getDigester
in interfaceRules
-
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
-
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
Registers a new Rule instance matching the specified pattern. This implementation sets theDigester
and thenamespaceURI
on theRule
before callingregisterRule(java.lang.String, org.apache.commons.digester.Rule)
. -
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
-
clear
Clear all existing Rule instance registrations. -
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.
-