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,- SetAllPropertiesRule,- SetContextPropertiesRule,- SetNextNamingRule,- SetNextRule,- SetPropertiesRule,- StoreFactoryRule
 
 public abstract class Rule extends java.lang.ObjectConcrete implementations of this class implement actions to be taken when a corresponding nested pattern of XML elements has been matched.
- 
- 
Field SummaryFields Modifier and Type Field Description protected DigesterdigesterThe Digester with which this Rule is associated.protected java.lang.StringnamespaceURIThe namespace URI for which this Rule is relevant, if any.
 - 
Constructor SummaryConstructors Constructor Description Rule()Base constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes)This method is called when the beginning of a matching XML element is encountered.voidbody(java.lang.String namespace, java.lang.String name, java.lang.String text)This method is called when the body of a matching XML element is encountered.voidend(java.lang.String namespace, java.lang.String name)This method is called when the end of a matching XML element is encountered.voidfinish()This method is called after all parsing methods have been called, to allow Rules to remove temporary data.DigestergetDigester()Identify the Digester with which this Rule is associated.java.lang.StringgetNamespaceURI()Return the namespace URI for which this Rule is relevant, if any.voidsetDigester(Digester digester)Set theDigesterwith which thisRuleis associated.voidsetNamespaceURI(java.lang.String namespaceURI)Set the namespace URI for which this Rule is relevant, if any.
 
- 
- 
- 
Field Detail- 
digesterprotected Digester digester The Digester with which this Rule is associated.
 - 
namespaceURIprotected java.lang.String namespaceURI The namespace URI for which this Rule is relevant, if any.
 
- 
 - 
Method Detail- 
getDigesterpublic Digester getDigester() Identify the Digester with which this Rule is associated.- Returns:
- the Digester with which this Rule is associated.
 
 - 
setDigesterpublic void setDigester(Digester digester) Set theDigesterwith which thisRuleis associated.- Parameters:
- digester- The digester with which to associate this rule
 
 - 
getNamespaceURIpublic java.lang.String getNamespaceURI() Return the namespace URI for which this Rule is relevant, if any.- Returns:
- The namespace URI for which this rule is relevant or
         nullif none.
 
 - 
setNamespaceURIpublic void setNamespaceURI(java.lang.String namespaceURI) Set the namespace URI for which this Rule is relevant, if any.- Parameters:
- namespaceURI- Namespace URI for which this Rule is relevant, or- nullto match independent of namespace.
 
 - 
beginpublic void begin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes) throws java.lang.ExceptionThis 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 namespace
- name- the local name if the parser is namespace aware, or just the element name otherwise
- attributes- The attribute list of this element
- Throws:
- java.lang.Exception- if an error occurs while processing the event
 
 - 
bodypublic void body(java.lang.String namespace, java.lang.String name, java.lang.String text) throws java.lang.ExceptionThis 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 namespace
- name- the local name if the parser is namespace aware, or just the element name otherwise
- text- The text of the body of this element
- Throws:
- java.lang.Exception- if an error occurs while processing the event
 
 - 
endpublic void end(java.lang.String namespace, java.lang.String name) throws java.lang.ExceptionThis 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 namespace
- name- the local name if the parser is namespace aware, or just the element name otherwise
- Throws:
- java.lang.Exception- if an error occurs while processing the event
 
 - 
finishpublic void finish() throws java.lang.ExceptionThis method is called after all parsing methods have been called, to allow Rules to remove temporary data.- Throws:
- java.lang.Exception- if an error occurs while processing the event
 
 
- 
 
-