|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jexl.parser.SimpleNode
public class SimpleNode
A Useful implementation of Node
. Mostly autogenerated by javacc
Field Summary | |
---|---|
protected Node[] |
children
children of this node. |
protected int |
id
id of the node. |
protected Node |
parent
parent node. |
protected Parser |
parser
parser that created the node. |
Constructor Summary | |
---|---|
SimpleNode(int i)
Create the node given an id. |
|
SimpleNode(Parser p,
int i)
Create a node with the given parser and id. |
Method Summary | |
---|---|
java.lang.Object |
childrenAccept(ParserVisitor visitor,
java.lang.Object data)
Visit all children. |
void |
dump(java.lang.String prefix)
Dump the node and all children. |
java.lang.Object |
execute(java.lang.Object o,
JexlContext ctx)
Used to let a node calcuate it's value.. |
boolean |
interpret(JexlContext pc)
basic interpret - just invoke interpret on all children. |
java.lang.Object |
jjtAccept(ParserVisitor visitor,
java.lang.Object data)
Accept the visitor. |
void |
jjtAddChild(Node n,
int i)
This method tells the node to add its argument to the node's list of children. |
void |
jjtClose()
End of the node. |
Node |
jjtGetChild(int i)
This method returns a child node. |
int |
jjtGetNumChildren()
Gets the number of children the node has. |
Node |
jjtGetParent()
Gets the parent node. |
void |
jjtOpen()
Start of the node. |
void |
jjtSetParent(Node n)
This pair of methods are used to inform the node of its parent. |
java.lang.Object |
setValue(JexlContext context,
java.lang.Object value)
Sets the value for the node - again, only makes sense for some nodes but lazyness tempts me to put it here. |
java.lang.String |
toString()
Gets a string representation of the node. |
java.lang.String |
toString(java.lang.String prefix)
Used during dumping to output the node with a prefix. |
java.lang.Object |
value(JexlContext context)
Gets the value of this node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Node parent
protected Node[] children
protected int id
protected Parser parser
Constructor Detail |
---|
public SimpleNode(int i)
i
- node id.public SimpleNode(Parser p, int i)
p
- a parser.i
- node id.Method Detail |
---|
public void jjtOpen()
jjtOpen
in interface Node
public void jjtClose()
jjtClose
in interface Node
public void jjtSetParent(Node n)
jjtSetParent
in interface Node
n
- the parent node.public Node jjtGetParent()
jjtGetParent
in interface Node
public void jjtAddChild(Node n, int i)
jjtAddChild
in interface Node
n
- the child node to addi
- the index to add it at.public Node jjtGetChild(int i)
jjtGetChild
in interface Node
i
- the index of the child to get.
public int jjtGetNumChildren()
jjtGetNumChildren
in interface Node
public java.lang.Object jjtAccept(ParserVisitor visitor, java.lang.Object data)
jjtAccept
in interface Node
visitor
- a ParserVisitor
.data
- data to be passed along to the visitor.
ParserVisitor.visit(org.apache.commons.jexl.parser.SimpleNode, java.lang.Object)
public java.lang.Object childrenAccept(ParserVisitor visitor, java.lang.Object data)
visitor
- a ParserVisitor
.data
- data to be passed along to the visitor.
ParserVisitor.visit(org.apache.commons.jexl.parser.SimpleNode, java.lang.Object)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String prefix)
prefix
- text to prefix toString()
public void dump(java.lang.String prefix)
prefix
- text to prefix the node output.public boolean interpret(JexlContext pc) throws java.lang.Exception
pc
- the context
to interpret against.
java.lang.Exception
- on any error.public java.lang.Object value(JexlContext context) throws java.lang.Exception
context
- the context to retrieve values from.
java.lang.Exception
- when evaluating the operands fails.public java.lang.Object setValue(JexlContext context, java.lang.Object value) throws java.lang.Exception
context
- the context to retrieve values from.value
- the value.
java.lang.Exception
- when evaluating the operands fails.public java.lang.Object execute(java.lang.Object o, JexlContext ctx) throws java.lang.Exception
o
- the object to calculate with.ctx
- the context to retrieve values from.
java.lang.Exception
- when calculating the value fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |