org.apache.commons.digester
Class Rule

java.lang.Object
  |
  +--org.apache.commons.digester.Rule
Direct Known Subclasses:
BeanPropertySetterRule, CallMethodRule, CallParamRule, DigesterRuleParser.IncludeRule, DigesterRuleParser.PatternRule, DigesterRuleParser.SetPropertiesAliasRule, FactoryCreateRule, ObjectCreateRule, SetNextRule, SetPropertiesRule, SetPropertyRule, SetRootRule, SetTopRule

public abstract class Rule
extends java.lang.Object

Concrete implementations of this class implement actions to be taken when a corresponding nested pattern of XML elements has been matched.

Version:
$Revision: 1.7 $ $Date: 2002/03/23 17:45:58 $
Author:
Craig McClanahan

Field Summary
protected  Digester digester
          The Digester with which this Rule is associated.
protected  java.lang.String namespaceURI
          The namespace URI for which this Rule is relevant, if any.
 
Constructor Summary
Rule()
          Base constructor.
Rule(Digester digester)
          Deprecated. The digester instance is now set in the Digester.addRule(java.lang.String, org.apache.commons.digester.Rule) method. Use Rule() instead.
 
Method Summary
 void begin(org.xml.sax.Attributes attributes)
          This method is called when the beginning of a matching XML element is encountered.
 void body(java.lang.String text)
          This method is called when the body of a matching XML element is encountered.
 void end()
          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.
 java.lang.String getNamespaceURI()
          Return the namespace URI for which this Rule is relevant, if any.
 void setDigester(Digester digester)
          Set the Digester with which this Rule is associated.
 void setNamespaceURI(java.lang.String namespaceURI)
          Set the namespace URI for which this Rule is relevant, if any.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

digester

protected Digester digester
The Digester with which this Rule is associated.

namespaceURI

protected java.lang.String namespaceURI
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 the Digester.addRule(java.lang.String, org.apache.commons.digester.Rule) method. Use Rule() 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 the Digester with which this Rule is associated.

getNamespaceURI

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

setNamespaceURI

public 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 null to match independent of namespace.

begin

public void begin(org.xml.sax.Attributes attributes)
           throws java.lang.Exception
This method is called when the beginning of a matching XML element is encountered.
Parameters:
attributes - The attribute list of this element

body

public void body(java.lang.String text)
          throws java.lang.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.
Parameters:
text - The text of the body of this element

end

public void end()
         throws java.lang.Exception
This method is called when the end of a matching XML element is encountered.

finish

public void finish()
            throws java.lang.Exception
This method is called after all parsing methods have been called, to allow Rules to remove temporary data.


Copyright (c) 2001-2002 - Apache Software Foundation