public abstract class Rule extends Object
Modifier and Type | Field and Description |
---|---|
protected Digester |
digester
The Digester with which this Rule is associated.
|
protected String |
namespaceURI
The namespace URI for which this Rule is relevant, if any.
|
Constructor and Description |
---|
Rule()
Base constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
begin(String namespace,
String name,
Attributes attributes)
This method is called when the beginning of a matching XML element
is encountered.
|
void |
body(String namespace,
String name,
String text)
This method is called when the body of a matching XML element is
encountered.
|
void |
end(String namespace,
String name)
This method is called when the end of a matching XML element
is encountered.
|
void |
finish()
This method is called after all parsing methods have been
called, to allow Rules to remove temporary data.
|
Digester |
getDigester()
Identify the Digester with which this Rule is associated.
|
String |
getNamespaceURI()
Return the namespace URI for which this Rule is relevant, if any.
|
void |
setDigester(Digester digester)
Set the
Digester with which this Rule is
associated. |
void |
setNamespaceURI(String namespaceURI)
Set the namespace URI for which this Rule is relevant, if any.
|
protected Digester digester
protected String namespaceURI
public Rule()
Base constructor. Now the digester will be set when the rule is added.
public Digester getDigester()
public void setDigester(Digester digester)
Digester
with which this Rule
is
associated.digester
- The digester with which to associate this rulepublic String getNamespaceURI()
null
if none.public void setNamespaceURI(String namespaceURI)
namespaceURI
- Namespace URI for which this Rule is relevant,
or null
to match independent of namespace.public void begin(String namespace, String name, Attributes attributes) throws Exception
namespace
- the namespace URI of the matching element, or an
empty string if the parser is not namespace aware or the
element has no namespacename
- the local name if the parser is namespace aware, or just
the element name otherwiseattributes
- The attribute list of this elementException
- if an error occurs while processing the eventpublic void body(String namespace, String name, String text) throws Exception
namespace
- the namespace URI of the matching element, or an empty
string if the parser is not namespace aware or the
element has no namespacename
- the local name if the parser is namespace aware, or just the
element name otherwisetext
- The text of the body of this elementException
- if an error occurs while processing the eventpublic void end(String namespace, String name) throws Exception
namespace
- the namespace URI of the matching element, or an empty
string if the parser is not namespace aware or the
element has no namespacename
- the local name if the parser is namespace aware, or just the
element name otherwiseException
- if an error occurs while processing the eventCopyright © 2000-2016 Apache Software Foundation. All Rights Reserved.