Top Description Fields Constructors Methods
org.apache.tomcat.util.digester

public abstract Class Rule

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.tomcat.util.digester.SetNextRule, org.apache.tomcat.util.digester.SetPropertiesRule, org.apache.catalina.realm.MemoryUserRule, org.apache.catalina.startup.AddPortOffsetRule, org.apache.catalina.startup.Catalina.SetParentClassLoaderRule, org.apache.catalina.startup.CertificateCreateRule, org.apache.catalina.startup.ConnectorCreateRule, org.apache.catalina.startup.CopyParentClassLoaderRule, org.apache.catalina.startup.LifecycleListenerRule, org.apache.catalina.startup.SetNextNamingRule, org.apache.tomcat.util.descriptor.web.SetLoginConfig, org.apache.tomcat.util.descriptor.web.SetJspConfig, org.apache.tomcat.util.descriptor.web.SetSessionConfig, org.apache.tomcat.util.descriptor.web.SetAuthConstraintRule, org.apache.tomcat.util.descriptor.web.SetDistributableRule, org.apache.tomcat.util.descriptor.web.SetDenyUncoveredHttpMethodsRule, org.apache.tomcat.util.descriptor.web.SetPublicIdRule, org.apache.tomcat.util.descriptor.web.ServletDefCreateRule, org.apache.tomcat.util.descriptor.web.IgnoreAnnotationsRule, org.apache.tomcat.util.descriptor.web.VersionRule, org.apache.tomcat.util.descriptor.web.NameRule, org.apache.tomcat.util.descriptor.web.AbsoluteOrderingRule, org.apache.tomcat.util.descriptor.web.RelativeOrderingRule, org.apache.tomcat.util.descriptor.web.SoapHeaderRule, org.apache.tomcat.util.descriptor.web.ServiceQnameRule, org.apache.tomcat.util.descriptor.web.TaglibLocationRule, org.apache.tomcat.util.descriptor.web.MappedNameRule, org.apache.tomcat.util.descriptor.web.SetOverrideRule, org.apache.tomcat.util.digester.CallMethodRule, org.apache.tomcat.util.digester.CallParamRule, org.apache.tomcat.util.digester.FactoryCreateRule, org.apache.tomcat.util.digester.ObjectCreateRule
Imports
org.apache.tomcat.util.res.StringManager, org.xml.sax.Attributes

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 TypeField 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.

protected static final StringManager

Constructor Summary

AccessConstructor and Description
public
Rule()

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public void
begin(String
the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
namespace
,
String
the local name if the parser is namespace aware, or just the element name otherwise
name
,
Attributes
The attribute list of this element
attributes
)

This method is called when the beginning of a matching XML element is encountered.

public void
body(String
the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
namespace
,
String
the local name if the parser is namespace aware, or just the element name otherwise
name
,
String
The text of the body of this element
text
)

This method is called when the body of a matching XML element is encountered.

public void
end(String
the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespace
namespace
,
String
the local name if the parser is namespace aware, or just the element name otherwise
name
)

This method is called when the end of a matching XML element is encountered.

public void
finish()

This method is called after all parsing methods have been called, to allow Rules to remove temporary data.

public Digester

Returns:

the Digester with which this Rule is associated.
getDigester
()

Identify the Digester with which this Rule is associated.

public String

Returns:

The namespace URI for which this rule is relevant or null if none.
getNamespaceURI
()

Return the namespace URI for which this Rule is relevant, if any.

public void
setDigester(Digester
The digester with which to associate this rule
digester
)

Set the Digester with which this Rule is associated.

public void
setNamespaceURI(String
Namespace URI for which this Rule is relevant, or null to match independent of namespace.
namespaceURI
)

Set the namespace URI for which this Rule is relevant, if any.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digesterback to summary
protected Digester digester

The Digester with which this Rule is associated.

namespaceURIback to summary
protected String namespaceURI

The namespace URI for which this Rule is relevant, if any.

smback to summary
protected static final StringManager sm

Constructor Detail

Ruleback to summary
public Rule()

Base constructor. Now the digester will be set when the rule is added.

Method Detail

beginback to summary
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 is a NO-OP.

Parameters
namespace:String

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:String

the local name if the parser is namespace aware, or just the element name otherwise

attributes:Attributes

The attribute list of this element

Exceptions
Exception:
if an error occurs while processing the event
bodyback to summary
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 is a NO-OP.

Parameters
namespace:String

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:String

the local name if the parser is namespace aware, or just the element name otherwise

text:String

The text of the body of this element

Exceptions
Exception:
if an error occurs while processing the event
endback to summary
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 is a NO-OP.

Parameters
namespace:String

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:String

the local name if the parser is namespace aware, or just the element name otherwise

Exceptions
Exception:
if an error occurs while processing the event
finishback to summary
public void finish() throws Exception

This method is called after all parsing methods have been called, to allow Rules to remove temporary data.

Exceptions
Exception:
if an error occurs while processing the event
getDigesterback to summary
public Digester getDigester()

Identify the Digester with which this Rule is associated.

Returns:Digester

the Digester with which this Rule is associated.

getNamespaceURIback to summary
public String getNamespaceURI()

Return the namespace URI for which this Rule is relevant, if any.

Returns:String

The namespace URI for which this rule is relevant or null if none.

setDigesterback to summary
public void setDigester(Digester digester)

Set the Digester with which this Rule is associated.

Parameters
digester:Digester

The digester with which to associate this rule

setNamespaceURIback to summary
public void setNamespaceURI(String namespaceURI)

Set the namespace URI for which this Rule is relevant, if any.

Parameters
namespaceURI:String

Namespace URI for which this Rule is relevant, or null to match independent of namespace.