Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.commons.digester.Rule
public abstract class Rule
extends java.lang.Object
Field Summary | |
protected Digester |
|
protected String |
|
Constructor Summary | |
| |
|
Method Summary | |
void | |
void |
|
void | |
void |
|
void | |
void |
|
void |
|
Digester |
|
String |
|
void |
|
void |
|
protected String namespaceURI
The namespace URI for which this Rule is relevant, if any.
public Rule()
Base constructor. Now the digester will be set when the rule is added.
public Rule(Digester digester)
Deprecated. The digester instance is now set in the
Digester.addRule(String,Rule)
method. UseRule()
instead.Constructor sets the associated Digester.
- Parameters:
digester
- The digester with which this rule is associated
public void begin(Attributes attributes) throws Exception
Deprecated. Use the
begin
method withnamespace
andname
parameters instead.This method is called when the beginning of a matching XML element is encountered.
- Parameters:
attributes
- The attribute list of this element
public void begin(String namespace, String name, Attributes attributes) throws Exception
This method is called when the beginning of a matching XML element is encountered. The default implementation delegates to the deprecated methodbegin
without thenamespace
andname
parameters, to retain backwards compatibility.
- Parameters:
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 element
- Since:
- Digester 1.4
public void body(String text) throws Exception
Deprecated. Use the
body
method withnamespace
andname
parameters instead.This method is called when the body of a matching XML element is encountered. If the element has no body, this method is not called at all.
- Parameters:
text
- The text of the body of this element
public void body(String namespace, String name, String text) throws Exception
This method is called when the body of a matching XML element is encountered. If the element has no body, this method is not called at all. The default implementation delegates to the deprecated methodbody
without thenamespace
andname
parameters, to retain backwards compatibility.
- Parameters:
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 element
- Since:
- Digester 1.4
public void end() throws Exception
Deprecated. Use the
end
method withnamespace
andname
parameters instead.This method is called when the end of a matching XML element is encountered.
public void end(String namespace, String name) throws Exception
This method is called when the end of a matching XML element is encountered. The default implementation delegates to the deprecated methodend
without thenamespace
andname
parameters, to retain backwards compatibility.
- Parameters:
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 otherwise
- Since:
- Digester 1.4
public void finish() throws Exception
This method is called after all parsing methods have been called, to allow Rules to remove temporary data.
public String getNamespaceURI()
Return the namespace URI for which this Rule is relevant, if any.
public void setDigester(Digester digester)
Set theDigester
with which thisRule
is associated.
public void setNamespaceURI(String namespaceURI)
Set the namespace URI for which this Rule is relevant, if any.
- Parameters:
namespaceURI
- Namespace URI for which this Rule is relevant, ornull
to match independent of namespace.