Package org.apache.tomcat.util.digester
Class Rule
- java.lang.Object
-
- org.apache.tomcat.util.digester.Rule
-
- Direct Known Subclasses:
CallMethodRule
,CallParamRule
,CopyParentClassLoaderRule
,FactoryCreateRule
,LifecycleListenerRule
,NodeCreateRule
,ObjectCreateRule
,ObjectParamRule
,PathCallParamRule
,SetAllPropertiesRule
,SetContextPropertiesRule
,SetDocBaseRule
,SetNextRule
,SetPropertiesRule
,SetPropertyRule
,SetRootRule
,SetTopRule
public abstract class Rule extends Object
Concrete implementations of this class implement actions to be taken when a corresponding nested pattern of XML elements has been matched.
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description Rule()
Base constructor.Rule(Digester digester)
Deprecated.The digester instance is now set in theDigester.addRule(java.lang.String, org.apache.tomcat.util.digester.Rule)
method.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
begin(String namespace, String name, Attributes attributes)
This method is called when the beginning of a matching XML element is encountered.void
begin(Attributes attributes)
Deprecated.void
body(String text)
Deprecated.void
body(String namespace, String name, String text)
This method is called when the body of a matching XML element is encountered.void
end()
Deprecated.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()
Return 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 theDigester
with which thisRule
is associated.void
setNamespaceURI(String namespaceURI)
Set the namespace URI for which this Rule is relevant, if any.
-
-
-
Constructor Detail
-
Rule
public Rule(Digester digester)
Deprecated.The digester instance is now set in theDigester.addRule(java.lang.String, org.apache.tomcat.util.digester.Rule)
method. UseRule()
instead.Constructor sets the associated Digester.- Parameters:
digester
- The digester with which this rule is associated
-
Rule
public Rule()
Base constructor. Now the digester will be set when the rule is added.
-
-
Method Detail
-
getDigester
public Digester getDigester()
Return the Digester with which this Rule is associated.
-
setDigester
public void setDigester(Digester digester)
Set theDigester
with which thisRule
is associated.
-
getNamespaceURI
public String getNamespaceURI()
Return the namespace URI for which this Rule is relevant, if any.
-
setNamespaceURI
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.
-
begin
public void begin(Attributes attributes) throws Exception
Deprecated.This method is called when the beginning of a matching XML element is encountered.- Parameters:
attributes
- The attribute list of this element- Throws:
Exception
-
begin
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- Throws:
Exception
- Since:
- Digester 1.4
-
body
public void body(String text) throws Exception
Deprecated.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- Throws:
Exception
-
body
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- Throws:
Exception
- Since:
- Digester 1.4
-
end
public void end() throws Exception
Deprecated.This method is called when the end of a matching XML element is encountered.- Throws:
Exception
-
end
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- Throws:
Exception
- Since:
- Digester 1.4
-
-