Class ASTSwitchStatement

All Implemented Interfaces:
JexlCache.Reference, Node
Direct Known Subclasses:
ASTSwitchExpression

public class ASTSwitchStatement extends JexlNode
  • Field Details

    • isStatement

      protected boolean isStatement
      Whether this switch is a statement (true) or an expression (false).
    • cases

      protected Map<Object,Integer> 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

      public Object jjtAccept(ParserVisitor visitor, Object data)
      Description copied from class: SimpleNode
      Accepts the visitor.
      Specified by:
      jjtAccept in interface Node
      Overrides:
      jjtAccept in class SimpleNode
      Parameters:
      visitor - The visitor
      data - contextual data
      Returns:
      result of visit
    • getCasesList

      public List<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(Object value)