KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > standard > lang > jpath > expression > Node


1 /*
2  * Copyright 1999,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.taglibs.standard.lang.jpath.expression;
18
19 import javax.servlet.jsp.PageContext JavaDoc;
20
21 import org.apache.taglibs.standard.lang.jpath.adapter.IterationContext;
22
23 /* All AST nodes must implement this interface. It provides basic
24    machinery for constructing the parent and child relationships
25    between nodes. */

26
27 /**
28  * The Node interface
29  *
30  *
31  * @author <a HREF='mailto:scott.hasse@isthmusgroup.com'>Scott Hasse</a>
32  * @version 0.9
33  */

34 public interface Node {
35
36     /**
37      * This method is called after the node has been made the current
38      * node. It indicates that child nodes can now be added to it.
39      */

40     public void jjtOpen();
41
42     /**
43      * This method is called after all the child nodes have been
44      * added.
45      */

46     public void jjtClose();
47
48     /**
49      * This pair of methods are used to inform the node of its
50      * parent.
51      *
52      * @param n
53      */

54     public void jjtSetParent(Node n);
55
56     /**
57      * The jjtGetParent method
58      *
59      *
60      * @return
61      *
62      */

63     public Node jjtGetParent();
64
65     /**
66      * This method tells the node to add its argument to the node's
67      * list of children.
68      *
69      * @param n
70      * @param i
71      */

72     public void jjtAddChild(Node n, int i);
73
74     /**
75      * This method returns a child node. The children are numbered
76      * from zero, left to right.
77      *
78      * @param i
79      *
80      * @return
81      */

82     public Node jjtGetChild(int i);
83
84     /**
85      * Return the number of children the node has.
86      *
87      * @return
88      */

89     public int jjtGetNumChildren();
90
91     /* Added by Scott Hasse */
92
93     /**
94      * The toNormalizedString method
95      *
96      *
97      * @return
98      *
99      */

100     public String JavaDoc toNormalizedString();
101
102     /**
103      * The evaluate method
104      *
105      *
106      * @param pageContext
107      * @param icontext
108      *
109      * @return
110      *
111      * @throws EvaluationException
112      *
113      */

114     public Object JavaDoc evaluate(PageContext JavaDoc pageContext, IterationContext icontext)
115         throws EvaluationException;
116
117     /**
118      * The validate method
119      *
120      *
121      * @throws ValidationException
122      *
123      */

124     public void validate() throws ValidationException;
125
126     /**
127      * The simplify method
128      *
129      *
130      * @return
131      *
132      */

133     public Node simplify();
134 }
135
Popular Tags