Class Statement

java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.stmt.Statement
All Implemented Interfaces:
NodeMetaDataHandler
Direct Known Subclasses:
AssertStatement, BlockStatement, BreakStatement, BytecodeSequence, CaseStatement, CatchStatement, ContinueStatement, DoWhileStatement, EmptyStatement, ExpressionStatement, ForStatement, IfStatement, ReturnStatement, SwitchStatement, SynchronizedStatement, ThrowStatement, TryCatchStatement, WhileStatement

public class Statement extends ASTNode
Base class for any statement.
  • Constructor Details

    • Statement

      public Statement()
  • Method Details

    • getStatementLabels

      public List<String> getStatementLabels()
    • getStatementLabel

      @Deprecated public String getStatementLabel()
      Deprecated.
    • setStatementLabel

      public void setStatementLabel(String label)
    • addStatementLabel

      public void addStatementLabel(String label)
    • copyStatementLabels

      public void copyStatementLabels(Statement that)
    • getStatementAnnotations

      public List<AnnotationNode> getStatementAnnotations()
      Returns the list of statement-level annotations attached to this statement. These are Groovy-only source-retention annotations that do not appear at the JVM level; they are processed by registered ASTTransformations.
      Returns:
      an unmodifiable view of the annotations list, never null
      Since:
      6.0.0
    • addStatementAnnotation

      public void addStatementAnnotation(AnnotationNode annotation)
      Attaches a statement-level annotation to this statement.
      Parameters:
      annotation - the annotation to attach
      Since:
      6.0.0
    • isEmpty

      public boolean isEmpty()