org.apache.tapestry.util.xml
Interface IRule

All Known Implementing Classes:
BaseRule, InitRule, ScriptRule, UniqueRule

public interface IRule

A rule that may be pushed onto the RuleDirectedParser's rule stack. A rule is associated with an XML element. It is pushed onto the stack when the open tag for the rule is encountered. It is is popped off the stack after the end-tag is encountered. It is notified about any text it directly wraps around.

Rules should be stateless, because a rule instance may appear multiple times in the rule stack (if elements can be recusively nested).

Since:
3.0
Version:
$Id: IRule.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Method Summary
 void content(RuleDirectedParser parser, String content)
          Invoked when real content is found.
 void endElement(RuleDirectedParser parser)
          Invoked just after the rule is popped off the rule stack.
 void startElement(RuleDirectedParser parser, org.xml.sax.Attributes attributes)
          Invoked just after the rule is pushed onto the rule stack.
 

Method Detail

startElement

void startElement(RuleDirectedParser parser,
                  org.xml.sax.Attributes attributes)
Invoked just after the rule is pushed onto the rule stack. Typically, a Rule will use the information to create a new object and push it onto the object stack. If the rule needs to know about the element (rather than the attributes), it may obtain the URI, localName and qName from the parser.


endElement

void endElement(RuleDirectedParser parser)
Invoked just after the rule is popped off the rule stack.


content

void content(RuleDirectedParser parser,
             String content)
Invoked when real content is found. The parser is responsible for aggregating all content provided by the underlying SAX parser into a single string.