Package org.apache.commons.jexl3.parser
Class JexlNode
java.lang.Object
org.apache.commons.jexl3.parser.SimpleNode
org.apache.commons.jexl3.parser.JexlNode
- All Implemented Interfaces:
Node
- Direct Known Subclasses:
ASTAddNode,ASTAmbiguous,ASTAndNode,ASTAnnotatedStatement,ASTAnnotation,ASTArguments,ASTArrayAccess,ASTArrayLiteral,ASTAssignment,ASTBitwiseAndNode,ASTBitwiseComplNode,ASTBitwiseOrNode,ASTBitwiseXorNode,ASTBreak,ASTConstructorNode,ASTContinue,ASTDecrementGetNode,ASTDefineVars,ASTDivNode,ASTDoWhileStatement,ASTEmptyFunction,ASTEQNode,ASTERNode,ASTEWNode,ASTExtendedLiteral,ASTFalseNode,ASTFunctionNode,ASTGENode,ASTGetDecrementNode,ASTGetIncrementNode,ASTGTNode,ASTIdentifier,ASTIdentifierAccess,ASTIfStatement,ASTIncrementGetNode,ASTJxltLiteral,ASTLENode,ASTLTNode,ASTMapEntry,ASTMapLiteral,ASTMethodNode,ASTModNode,ASTMulNode,ASTNENode,ASTNEWNode,ASTNotNode,ASTNRNode,ASTNSWNode,ASTNullLiteral,ASTNullpNode,ASTNumberLiteral,ASTOrNode,ASTQualifiedIdentifier,ASTRangeNode,ASTReference,ASTReferenceExpression,ASTRegexLiteral,ASTReturnStatement,ASTSetAddNode,ASTSetAndNode,ASTSetDivNode,ASTSetLiteral,ASTSetModNode,ASTSetMultNode,ASTSetOrNode,ASTSetShiftLeftNode,ASTSetShiftRightNode,ASTSetShiftRightUnsignedNode,ASTSetSubNode,ASTSetXorNode,ASTShiftLeftNode,ASTShiftRightNode,ASTShiftRightUnsignedNode,ASTSizeFunction,ASTStringLiteral,ASTSubNode,ASTSWNode,ASTTernaryNode,ASTTrueNode,ASTUnaryMinusNode,ASTUnaryPlusNode,ASTWhileStatement,JexlLexicalNode
Base class for parser nodes - holds an 'image' of the token for later use.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA marker interface for constants.static interfaceMarker interface for cachable function calls.static classAn info bound to its node. -
Field Summary
FieldsFields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears any cached value of type JexlProperty{G,S}et or JexlMethod.intintgetLine()booleanWhether this node is a constant node.protected booleanisConstant(boolean literal) booleanbooleanWhether this node is a left value.booleanisSafeLhs(boolean safe) Whether this node is the left-hand side of a safe access identifier as in.booleanisStrictOperator(JexlArithmetic arithmetic) Checks whether this node is an operator that accepts a null argument even when arithmetic is in strict mode.jexlInfo()Gets the associated JexlInfo instance.voidvoidMethods inherited from class org.apache.commons.jexl3.parser.SimpleNode
childrenAccept, dump, dumpOut, getId, jjtAccept, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetChildren, jjtSetParent, jjtSetValue, toString, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
lc
private int lc
-
-
Constructor Details
-
JexlNode
public JexlNode(int id) -
JexlNode
-
-
Method Details
-
jjtSetFirstToken
-
jjtSetLastToken
-
getLine
public int getLine() -
getColumn
public int getColumn() -
jexlInfo
Gets the associated JexlInfo instance.- Returns:
- the info
-
clearCache
public void clearCache()Clears any cached value of type JexlProperty{G,S}et or JexlMethod.This is called when the engine detects the evaluation of a script occurs with a class loader different that the one that created it.
-
isStrictOperator
Checks whether this node is an operator that accepts a null argument even when arithmetic is in strict mode. The default cases are equals and not equals.- Returns:
- true if node accepts null arguments, false otherwise
-
isConstant
public boolean isConstant()Whether this node is a constant node.Its value can not change after the first evaluation and can be cached indefinitely.
- Returns:
- true if constant, false otherwise
-
isConstant
protected boolean isConstant(boolean literal) -
isLeftValue
public boolean isLeftValue()Whether this node is a left value.- Returns:
- true if node is assignable, false otherwise
-
isGlobalVar
public boolean isGlobalVar()- Returns:
- true if this node looks like a global var
-
isSafeLhs
public boolean isSafeLhs(boolean safe) Whether this node is the left-hand side of a safe access identifier as in. For instance, in 'x?.y' , 'x' is safe.- Parameters:
safe- whether the engine is in safe-navigation mode- Returns:
- true if safe lhs, false otherwise
-