Package org.apache.commons.jexl3.parser
Class ASTSwitchStatement
java.lang.Object
org.apache.commons.jexl3.parser.SimpleNode
org.apache.commons.jexl3.parser.JexlNode
org.apache.commons.jexl3.parser.ASTSwitchStatement
- All Implemented Interfaces:
JexlCache.Reference,Node
- Direct Known Subclasses:
ASTSwitchExpression
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHelper for switch statements.Nested classes/interfaces inherited from class org.apache.commons.jexl3.parser.JexlNode
JexlNode.Constant<T>, JexlNode.Funcall, JexlNode.Info, JexlNode.JxltHandle -
Field Summary
FieldsModifier and TypeFieldDescriptionThe map of cases, where the key is the case value and the value is the switch index.protected booleanWhether this switch is a statement (true) or an expression (false).Fields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the array of cases values.booleanjjtAccept(ParserVisitor visitor, Object data) Accepts the visitor.intswitchIndex(Object value) Methods inherited from class org.apache.commons.jexl3.parser.JexlNode
clearCache, getCache, getColumn, getLine, isConstant, isConstant, isGlobalVar, isLeftValue, isSafeLhs, isStrictOperator, jexlInfo, jexlInfo, jjtSetFirstToken, jjtSetLastToken, setCacheMethods inherited from class org.apache.commons.jexl3.parser.SimpleNode
childrenAccept, dump, dumpOut, getId, jjtAddChild, jjtClose, jjtGetChild, jjtGetNumChildren, jjtGetParent, jjtGetValue, jjtOpen, jjtSetChildren, jjtSetParent, jjtSetValue, toString, toString
-
Field Details
-
isStatement
protected boolean isStatementWhether this switch is a statement (true) or an expression (false). -
cases
The map of cases, where the key is the case value and the value is the switch index.
-
-
Constructor Details
-
ASTSwitchStatement
public ASTSwitchStatement(int id)
-
-
Method Details
-
jjtAccept
Description copied from class:SimpleNodeAccepts the visitor.- Specified by:
jjtAcceptin interfaceNode- Overrides:
jjtAcceptin classSimpleNode- Parameters:
visitor- The visitordata- contextual data- Returns:
- result of visit
-
getCasesList
Returns the array of cases values.Meant only for verification during tests.
The list at each index contains the case values for that index. If the values-list is empty for an index, it is the default case.- Returns:
- An array of case values
-
isStatement
public boolean isStatement() -
switchIndex
-