Class SimpleNode
java.lang.Object
edu.internet2.middleware.grouperClientExt.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
-
Constructor Summary
ConstructorDescriptionSimpleNode
(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.void
jjtAccept
(ParserVisitor visitor, Object data) Accept the visitor.void
jjtAddChild
(Node n, int i) Adds a child node.void
jjtClose()
This method is called after all the child nodes have been added.jjtGetChild
(int i) Gets a child of this node.int
Gets this node number of children.Gets this node's parent.Gets this node value.void
jjtOpen()
This method is called after the node has been made the current node.void
jjtSetParent
(Node n) Sets this node's parent.void
jjtSetValue
(Object value) Sets this node value.toString()
-
Field Details
-
parent
The parent node. -
children
The array of children nodes. -
id
protected final int idThe node type id. -
value
volatile value so it can be used as a last evaluation cache.
-
-
Constructor Details
-
SimpleNode
public SimpleNode(int i) Creates a SimpleNode instance.- Parameters:
i
- the node type identifier
-
SimpleNode
Creates a SimpleNode instance.- Parameters:
p
- the parser instancei
- the node type identifier
-
-
Method Details
-
jjtOpen
public void jjtOpen()This method is called after the node has been made the current node. It indicates that child nodes can now be added to it. -
jjtClose
public void jjtClose()This method is called after all the child nodes have been added. -
jjtSetParent
Sets this node's parent.- Specified by:
jjtSetParent
in interfaceNode
- Parameters:
n
- the parent
-
jjtGetParent
Gets this node's parent.- Specified by:
jjtGetParent
in interfaceNode
- Returns:
- the parent node
-
jjtAddChild
Adds a child node.- Specified by:
jjtAddChild
in interfaceNode
- Parameters:
n
- the child nodei
- the child offset
-
jjtGetChild
Gets a child of this node.- Specified by:
jjtGetChild
in interfaceNode
- Parameters:
i
- the child offset- Returns:
- the child node
-
jjtGetNumChildren
public int jjtGetNumChildren()Gets this node number of children.- Specified by:
jjtGetNumChildren
in interfaceNode
- Returns:
- the number of children
-
jjtSetValue
Sets this node value.- Parameters:
value
-
-
jjtGetValue
Gets this node value.- Returns:
- value
-
jjtAccept
Accept the visitor. -
childrenAccept
Accept the visitor on all this node's children.- Parameters:
visitor
- the visitordata
- contextual data- Returns:
- result of visit
-
toString
-
toString
-
dump
-