public class SimpleNode extends Object implements Node
Node
. Mostly autogenerated by javaccModifier and Type | Field and Description |
---|---|
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 and Description |
---|
SimpleNode(int i)
Create the node given an id.
|
SimpleNode(Parser p,
int i)
Create a node with the given parser and id.
|
Modifier and Type | Method and Description |
---|---|
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..
|
protected Uberspect |
getUberspect() |
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.
|
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.
|
protected Node parent
protected Node[] children
protected int id
protected Parser parser
public SimpleNode(int i)
i
- node id.public SimpleNode(Parser p, int i)
p
- a parser.i
- node id.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()
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
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.protected Uberspect getUberspect()
Copyright © 2014 The Apache Software Foundation. All rights reserved.