org.apache.commons.jexl.parser
public class SimpleNode extends java.lang.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 org.apache.commons.jexl.parser.Parser |
parser
parser that created the node.
|
Constructor and Description |
---|
SimpleNode(int i)
Create the node given an id.
|
SimpleNode(org.apache.commons.jexl.parser.Parser p,
int i)
Create a node with the given parser and id.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
childrenAccept(org.apache.commons.jexl.parser.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..
|
protected Uberspect |
getUberspect() |
boolean |
interpret(JexlContext pc)
basic interpret - just invoke interpret on all children.
|
java.lang.Object |
jjtAccept(org.apache.commons.jexl.parser.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.
|
protected Node parent
protected Node[] children
protected int id
protected org.apache.commons.jexl.parser.Parser parser
public SimpleNode(int i)
i
- node id.public SimpleNode(org.apache.commons.jexl.parser.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 java.lang.Object jjtAccept(org.apache.commons.jexl.parser.ParserVisitor visitor, java.lang.Object data)
public java.lang.Object childrenAccept(org.apache.commons.jexl.parser.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.protected Uberspect getUberspect()
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.