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
public class ASTSwitchStatement extends JexlNode
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classASTSwitchStatement.HelperHelper 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
Fields Modifier and Type Field Description protected java.util.Map<java.lang.Object,java.lang.Integer>casesThe map of cases, where the key is the case value and the value is the switch index.protected booleanisStatementWhether this switch is a statement (true) or an expression (false).-
Fields inherited from class org.apache.commons.jexl3.parser.SimpleNode
id
-
-
Constructor Summary
Constructors Constructor Description ASTSwitchStatement(int id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Object>[]getCasesList()Returns the array of cases values.booleanisStatement()java.lang.ObjectjjtAccept(ParserVisitor visitor, java.lang.Object data)Accepts the visitor.intswitchIndex(java.lang.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, setCache
-
Methods 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
-
-
-
-
Method Detail
-
jjtAccept
public java.lang.Object jjtAccept(ParserVisitor visitor, java.lang.Object data)
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
public java.util.List<java.lang.Object>[] 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
public int switchIndex(java.lang.Object value)
-
-