Class SimpleNode
java.lang.Object
org.apache.commons.jexl2.parser.SimpleNode
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
JexlNode
A class originally generated by JJTree with the following JavaCCOptions:
MULTI=true,NODE_USES_PARSER=true,VISITOR=true,TRACK_TOKENS=false,NODE_PREFIX=AST,NODE_EXTENDS=,NODE_FACTORY=
Works around issue https://javacc.dev.java.net/issues/show_bug.cgi?id=227
As soon as this issue if fixed and the maven plugin uses the correct version of Javacc, this
class can go away.
The technical goal is to ensure every reference made in the parser was to a JexlNode; unfortunately,
as in javacc 4.1, it still uses a SimpleNode reference in the generated ParserVisitor.
Besides, there is no need to keep the parser around in the node.
The functional goal is to a allow a volatile value in the node
so it can serve as a last evaluation cache even in multi-threaded executions.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleNode(int i) Creates a SimpleNode instance.SimpleNode(Parser p, int i) Creates a SimpleNode instance. -
Method Summary
Modifier and TypeMethodDescriptionchildrenAccept(ParserVisitor visitor, Object data) Accept the visitor on all this node's children.voidintgetId()jjtAccept(ParserVisitor visitor, Object data) Accept the visitor.voidjjtAddChild(Node n, int i) Adds a child node.voidjjtClose()This method is called after all the child nodes have been added.jjtGetChild(int i) Gets a child of this node.intGets this node number of children.Gets this node's parent.Gets this node value.voidjjtOpen()This method is called after the node has been made the current node.voidjjtSetParent(Node n) Sets this node's parent.voidjjtSetValue(Object value) Sets this node value.toString()
-
Field Details
-
parent
-
children
-
id
The node type id. -
value
-
-
Constructor Details
-
SimpleNode
-
SimpleNode
Creates a SimpleNode instance.- Parameters:
p- the parser instancei- the node type identifier
-
-
Method Details
-
jjtOpen
-
jjtClose
-
jjtSetParent
Sets this node's parent.- Specified by:
jjtSetParentin interfaceNode- Parameters:
n- the parent
-
jjtGetParent
Gets this node's parent.- Specified by:
jjtGetParentin interfaceNode- Returns:
- the parent node
-
jjtAddChild
Adds a child node.- Specified by:
jjtAddChildin interfaceNode- Parameters:
n- the child nodei- the child offset
-
jjtGetChild
Gets a child of this node.- Specified by:
jjtGetChildin interfaceNode- Parameters:
i- the child offset- Returns:
- the child node
-
jjtGetNumChildren
Gets this node number of children.- Specified by:
jjtGetNumChildrenin interfaceNode- Returns:
- the number of children
-
jjtSetValue
-
jjtGetValue
-
jjtAccept
-
childrenAccept
Accept the visitor on all this node's children.- Parameters:
visitor- the visitordata- contextual data- Returns:
- result of visit
-
toString
-
toString
-
dump
-
getId
-