Top Description Fields Constructors Methods
org.apache.commons.jexl2.parser

public Class SimpleNode

extends Object
implements Node
Class Inheritance
All Implemented Interfaces
org.apache.commons.jexl2.parser.Node
Known Direct Subclasses
org.apache.commons.jexl2.parser.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

Modifier and TypeField and Description
protected JexlNode[]
children

The array of children nodes.

protected final int
id

The node type id.

protected JexlNode
parent

The parent node.

protected volatile Object
value

volatile value so it can be used as a last evaluation cache.

Constructor Summary

AccessConstructor and Description
public
SimpleNode(int
the node type identifier
i
)

Creates a SimpleNode instance.

public
SimpleNode(Parser
the parser instance
p
,
int
the node type identifier
i
)

Creates a SimpleNode instance.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

result of visit
childrenAccept
(ParserVisitor
the visitor
visitor
,
Object
contextual data
data
)

Accept the visitor on all this node's children.

public void
dump(String prefix)

public Object

Returns:

result of visit
jjtAccept
(ParserVisitor
the visitor
visitor
,
Object
contextual data
data
)

Implements org.apache.commons.jexl2.parser.Node.jjtAccept.

Accept the visitor.
public void
jjtAddChild(Node
the child node
n
,
int
the child offset
i
)

Implements org.apache.commons.jexl2.parser.Node.jjtAddChild.

Adds a child node.
public void
jjtClose()

Implements org.apache.commons.jexl2.parser.Node.jjtClose.

This method is called after all the child nodes have been added.
public JexlNode

Returns:

the child node
jjtGetChild
(int
the child offset
i
)

Implements org.apache.commons.jexl2.parser.Node.jjtGetChild.

Gets a child of this node.
public int

Returns:

the number of children
jjtGetNumChildren
()

Implements org.apache.commons.jexl2.parser.Node.jjtGetNumChildren.

Gets this node number of children.
public JexlNode

Returns:

the parent node
jjtGetParent
()

Implements org.apache.commons.jexl2.parser.Node.jjtGetParent.

Gets this node's parent.
public Object

Returns:

value
jjtGetValue
()

Gets this node value.

public void
jjtOpen()

Implements org.apache.commons.jexl2.parser.Node.jjtOpen.

This method is called after the node has been made the current node.
public void
jjtSetParent(Node
the parent
n
)

Implements org.apache.commons.jexl2.parser.Node.jjtSetParent.

Sets this node's parent.
public void
jjtSetValue(Object value)

Sets this node value.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
toString(String prefix)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

childrenback to summary
protected JexlNode[] children

The array of children nodes.

idback to summary
protected final int id

The node type id.

parentback to summary
protected JexlNode parent

The parent node.

valueback to summary
protected volatile Object value

volatile value so it can be used as a last evaluation cache.

Constructor Detail

SimpleNodeback to summary
public SimpleNode(int i)

Creates a SimpleNode instance.

Parameters
i:int

the node type identifier

SimpleNodeback to summary
public SimpleNode(Parser p, int i)

Creates a SimpleNode instance.

Parameters
p:Parser

the parser instance

i:int

the node type identifier

Method Detail

childrenAcceptback to summary
public Object childrenAccept(ParserVisitor visitor, Object data)

Accept the visitor on all this node's children.

Parameters
visitor:ParserVisitor

the visitor

data:Object

contextual data

Returns:Object

result of visit

dumpback to summary
public void dump(String prefix)
jjtAcceptback to summary
public Object jjtAccept(ParserVisitor visitor, Object data)

Implements org.apache.commons.jexl2.parser.Node.jjtAccept.

Accept the visitor.

Parameters
visitor:ParserVisitor

the visitor

data:Object

contextual data

Returns:Object

result of visit

jjtAddChildback to summary
public void jjtAddChild(Node n, int i)

Implements org.apache.commons.jexl2.parser.Node.jjtAddChild.

Adds a child node.

Parameters
n:Node

the child node

i:int

the child offset

jjtCloseback to summary
public void jjtClose()

Implements org.apache.commons.jexl2.parser.Node.jjtClose.

Doc from org.apache.commons.jexl2.parser.Node.jjtClose.

This method is called after all the child nodes have been added.

jjtGetChildback to summary
public JexlNode jjtGetChild(int i)

Implements org.apache.commons.jexl2.parser.Node.jjtGetChild.

Gets a child of this node.

Parameters
i:int

the child offset

Returns:JexlNode

the child node

jjtGetNumChildrenback to summary
public int jjtGetNumChildren()

Implements org.apache.commons.jexl2.parser.Node.jjtGetNumChildren.

Gets this node number of children.

Returns:int

the number of children

jjtGetParentback to summary
public JexlNode jjtGetParent()

Implements org.apache.commons.jexl2.parser.Node.jjtGetParent.

Gets this node's parent.

Returns:JexlNode

the parent node

jjtGetValueback to summary
public Object jjtGetValue()

Gets this node value.

Returns:Object

value

jjtOpenback to summary
public void jjtOpen()

Implements org.apache.commons.jexl2.parser.Node.jjtOpen.

Doc from org.apache.commons.jexl2.parser.Node.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.

jjtSetParentback to summary
public void jjtSetParent(Node n)

Implements org.apache.commons.jexl2.parser.Node.jjtSetParent.

Sets this node's parent.

Parameters
n:Node

the parent

jjtSetValueback to summary
public void jjtSetValue(Object value)

Sets this node value.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
toStringback to summary
public String toString(String prefix)