Package org.apache.tomcat.util.digester
Class Rule
java.lang.Object
org.apache.tomcat.util.digester.Rule
- Direct Known Subclasses:
AddPortOffsetRule
,CallMethodRule
,CallParamRule
,CertificateCreateRule
,ConnectorCreateRule
,CopyParentClassLoaderRule
,FactoryCreateRule
,LifecycleListenerRule
,ObjectCreateRule
,SetNextNamingRule
,SetNextRule
,SetPropertiesRule
,StoreFactoryRule
Concrete implementations of this class implement actions to be taken when
a corresponding nested pattern of XML elements has been matched.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Digester
The Digester with which this Rule is associated.protected String
The namespace URI for which this Rule is relevant, if any.protected static final StringManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
begin
(String namespace, String name, Attributes attributes) This method is called when the beginning of a matching XML element is encountered.void
This method is called when the body of a matching XML element is encountered.void
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.Identify the Digester with which this Rule is associated.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.
-
Field Details
-
sm
-
digester
The Digester with which this Rule is associated. -
namespaceURI
The namespace URI for which this Rule is relevant, if any.
-
-
Constructor Details
-
Rule
public Rule()Base constructor. Now the digester will be set when the rule is added.
-
-
Method Details
-
getDigester
Identify the Digester with which this Rule is associated.- Returns:
- the Digester with which this Rule is associated.
-
setDigester
Set theDigester
with which thisRule
is associated.- Parameters:
digester
- The digester with which to associate this rule
-
getNamespaceURI
Return the namespace URI for which this Rule is relevant, if any.- Returns:
- The namespace URI for which this rule is relevant or
null
if none.
-
setNamespaceURI
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
This method is called when the beginning of a matching XML element is encountered. The default implementation is a NO-OP.- 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
- if an error occurs while processing the event
-
body
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 is a NO-OP.- 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
- if an error occurs while processing the event
-
end
This method is called when the end of a matching XML element is encountered. The default implementation is a NO-OP.- 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
- if an error occurs while processing the event
-
finish
This method is called after all parsing methods have been called, to allow Rules to remove temporary data.- Throws:
Exception
- if an error occurs while processing the event
-