Class SwitchStatement

All Implemented Interfaces:
NodeMetaDataHandler

public class SwitchStatement extends Statement
Represents a switch (object) { case value: ... case [1, 2, 3]: ... default: ... } statement in Groovy.
  • Constructor Details

  • Method Details

    • visit

      public void visit(GroovyCodeVisitor visitor)
      Overrides:
      visit in class ASTNode
    • getCaseStatements

      public List<CaseStatement> getCaseStatements()
    • getExpression

      public Expression getExpression()
    • setExpression

      public void setExpression(Expression e)
    • getDefaultStatement

      public Statement getDefaultStatement()
    • setDefaultStatement

      public void setDefaultStatement(Statement defaultStatement)
    • addCase

      public void addCase(CaseStatement caseStatement)
    • getCaseStatement

      public CaseStatement getCaseStatement(int idx)
      Returns:
      the case statement of the given index or null