public abstract class AbstractRulesImpl extends Object implements Rules
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.
Constructor and Description |
---|
AbstractRulesImpl() |
Modifier and Type | Method and Description |
---|---|
void |
add(String pattern,
Rule rule)
Register a new Rule instance matching the specified pattern.
|
Digester |
getDigester()
Return the Digester instance with which this Rules instance is associated.
|
String |
getNamespaceURI()
Return the namespace URI that will be applied to all subsequently added
Rule 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 added
Rule objects. |
public AbstractRulesImpl()
public Digester getDigester()
getDigester
in interface Rules
public void setDigester(Digester digester)
setDigester
in interface Rules
digester
- The newly associated Digester instancepublic String getNamespaceURI()
Rule
objects.getNamespaceURI
in interface Rules
Rule
objects.public void setNamespaceURI(String namespaceURI)
Rule
objects.setNamespaceURI
in interface Rules
namespaceURI
- Namespace URI that must match on all subsequently added rules, or null
for
matching regardless of the current namespace URIpublic final void add(String pattern, Rule rule)
protected abstract void registerRule(String pattern, Rule rule)
Rule
can
be assumed to have been set properly before this method is called.pattern
- Nesting pattern to be matched for this Rulerule
- Rule instance to be registeredCopyright © 2001-2013 The Apache Software Foundation. All Rights Reserved.