FileDocCategorySizeDatePackage
Rule.javaAPI DocApache Tomcat 6.0.147397Fri Jul 20 04:20:34 BST 2007org.apache.tomcat.util.digester

Rule

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.

Fields Summary
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.
Constructors Summary
public Rule(Digester digester)
Constructor sets the associated Digester.

param
digester The digester with which this rule is associated
deprecated
The digester instance is now set in the {@link Digester#addRule} method. Use {@link #Rule()} instead.


        super();
        setDigester(digester);

    
public Rule()

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

Methods Summary
public voidbegin(org.xml.sax.Attributes attributes)
This method is called when the beginning of a matching XML element is encountered.

param
attributes The attribute list of this element
deprecated
Use the {@link #begin(String,String,Attributes) begin} method with namespace and name parameters instead.


        ;	// The default implementation does nothing

    
public 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. The default implementation delegates to the deprecated method {@link #begin(Attributes) begin} without the namespace and name parameters, to retain backwards compatibility.

param
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
param
name the local name if the parser is namespace aware, or just the element name otherwise
param
attributes The attribute list of this element
since
Digester 1.4


        begin(attributes);

    
public 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. If the element has no body, this method is not called at all. The default implementation delegates to the deprecated method {@link #body(String) body} without the namespace and name parameters, to retain backwards compatibility.

param
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
param
name the local name if the parser is namespace aware, or just the element name otherwise
param
text The text of the body of this element
since
Digester 1.4


        body(text);

    
public voidbody(java.lang.String text)
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.

param
text The text of the body of this element
deprecated
Use the {@link #body(String,String,String) body} method with namespace and name parameters instead.


        ;	// The default implementation does nothing

    
public voidend()
This method is called when the end of a matching XML element is encountered.

deprecated
Use the {@link #end(String,String) end} method with namespace and name parameters instead.


        ;	// The default implementation does nothing

    
public voidend(java.lang.String namespace, java.lang.String name)
This method is called when the end of a matching XML element is encountered. The default implementation delegates to the deprecated method {@link #end end} without the namespace and name parameters, to retain backwards compatibility.

param
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
param
name the local name if the parser is namespace aware, or just the element name otherwise
since
Digester 1.4


        end();

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


        ;	// The default implementation does nothing

    
public DigestergetDigester()
Return the Digester with which this Rule is associated.



    // ------------------------------------------------------------- Properties


                  
       

        return (this.digester);

    
public java.lang.StringgetNamespaceURI()
Return the namespace URI for which this Rule is relevant, if any.


        return (this.namespaceURI);

    
public voidsetDigester(Digester digester)
Set the Digester with which this Rule is associated.

        
        this.digester = digester;
        
    
public voidsetNamespaceURI(java.lang.String namespaceURI)
Set the namespace URI for which this Rule is relevant, if any.

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


        this.namespaceURI = namespaceURI;