|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
IRule.java | - | - | - | - |
|
1 | // Copyright 2004, 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | ||
15 | package org.apache.tapestry.util.xml; | |
16 | ||
17 | import org.xml.sax.Attributes; | |
18 | ||
19 | /** | |
20 | * A rule that may be pushed onto the {@link org.apache.tapestry.util.xml.RuleDirectedParser}'s | |
21 | * rule stack. A rule is associated with an XML element. It is pushed onto the stack when the | |
22 | * open tag for the rule is encountered. It is is popped off the stack after the end-tag is | |
23 | * encountered. It is notified about any text it directly wraps around. | |
24 | * | |
25 | * <p>Rules should be stateless, because a rule instance may appear multiple times in the | |
26 | * rule stack (if elements can be recusively nested). | |
27 | * | |
28 | * @author Howard Lewis Ship | |
29 | * @since 3.0 | |
30 | **/ | |
31 | ||
32 | public interface IRule | |
33 | { | |
34 | /** | |
35 | * Invoked just after the rule is pushed onto the rule stack. Typically, a Rule will | |
36 | * use the information to create a new object and push it onto the object stack. | |
37 | * If the rule needs to know about the element (rather than the attributes), it | |
38 | * may obtain the URI, localName and qName from the parser. | |
39 | * | |
40 | */ | |
41 | public void startElement(RuleDirectedParser parser, Attributes attributes); | |
42 | ||
43 | /** | |
44 | * Invoked just after the rule is popped off the rule stack. | |
45 | */ | |
46 | public void endElement(RuleDirectedParser parser); | |
47 | ||
48 | ||
49 | /** | |
50 | * Invoked when real content is found. The parser is responsible for aggregating | |
51 | * all content provided by the underlying SAX parser into a single string. | |
52 | */ | |
53 | ||
54 | public void content(RuleDirectedParser parser, String content); | |
55 | } |
|