|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.jexl.parser.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 | |
---|---|
Object |
childrenAccept(ParserVisitor visitor,
Object data)
Visit all children. |
void |
dump(String prefix)
Dump the node and all children. |
Object |
execute(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. |
Object |
jjtAccept(ParserVisitor visitor,
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. The children are numbered from zero, left to right. |
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. |
Object |
setValue(JexlContext context,
Object value)
Sets the value for the node - again, only makes sense for some nodes but lazyness tempts me to put it here. |
String |
toString()
Gets a string representation of the node. |
String |
toString(String prefix)
Used during dumping to output the node with a prefix. |
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 Object jjtAccept(ParserVisitor visitor, 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 Object childrenAccept(ParserVisitor visitor, 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 String toString()
toString
in class Object
public String toString(String prefix)
prefix
- text to prefix toString()
public void dump(String prefix)
prefix
- text to prefix the node output.public boolean interpret(JexlContext pc) throws Exception
pc
- the context
to interpret against.
Exception
- on any error.public Object value(JexlContext context) throws Exception
context
- the context to retrieve values from.
Exception
- when evaluating the operands fails.public Object setValue(JexlContext context, Object value) throws Exception
context
- the context to retrieve values from.value
- the value.
Exception
- when evaluating the operands fails.public Object execute(Object o, JexlContext ctx) throws Exception
o
- the object to calculate with.ctx
- the context to retrieve values from.
Exception
- when calculating the value fails.
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |