org.codehaus.groovy.ast.stmt

## Class BlockStatement

- java.lang.Object
- - org.codehaus.groovy.ast.ASTNode
  - - org.codehaus.groovy.ast.stmt.Statement
    - - org.codehaus.groovy.ast.stmt.BlockStatement

-     public class BlockStatement
      extends Statement

  A list of statements and a scope.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlockStatement()`
    `BlockStatement(java.util.List<Statement> statements, VariableScope scope)` Creates a BlockStatement with a scope and children statements.
    `BlockStatement(Statement[] statements, VariableScope scope)` Creates a BlockStatement with a scope and children statements.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addStatement(Statement statement)`
    `void` | `addStatements(java.util.List<Statement> listOfStatements)`
    `java.util.List<Statement>` | `getStatements()`
    `java.lang.String` | `getText()`
    `VariableScope` | `getVariableScope()`
    `boolean` | `isEmpty()`
    `void` | `setVariableScope(VariableScope scope)`
    `java.lang.String` | `toString()`
    `void` | `visit(GroovyCodeVisitor visitor)`

    - ### Methods inherited from class org.codehaus.groovy.ast.stmt.Statement

      `addStatementLabel, getStatementLabel, getStatementLabels, setStatementLabel`

    - ### Methods inherited from class org.codehaus.groovy.ast.ASTNode

      `copyNodeMetaData, equals, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, hashCode, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BlockStatement

          public BlockStatement()

    - #### BlockStatement

          public BlockStatement(java.util.List<Statement> statements,
                                VariableScope scope)

      Creates a BlockStatement with a scope and children statements.
      Parameters:
        `statements` - the statements. Do not pass null. If you do, no exception will occur, but a NullPointerException will eventually occur later. Also, a reference to the list is kept, so modifying the List later does effect this class.
        `scope` - the scope

    - #### BlockStatement

          public BlockStatement(Statement[] statements,
                                VariableScope scope)

      Creates a BlockStatement with a scope and children statements.
      Parameters:
        `statements` - the statements, which cannot be null or an exception occurs. No reference to the array is held, so modifying the array later has no effect on this class.
        `scope` - the scope

  - ### Method Detail

    - #### visit

          public void visit(GroovyCodeVisitor visitor)

      Overrides:
        `visit` in class `ASTNode`

    - #### getStatements

          public java.util.List<Statement> getStatements()

    - #### addStatement

          public void addStatement(Statement statement)

    - #### addStatements

          public void addStatements(java.util.List<Statement> listOfStatements)

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### getText

          public java.lang.String getText()

      Overrides:
        `getText` in class `ASTNode`

    - #### isEmpty

          public boolean isEmpty()

      Overrides:
        `isEmpty` in class `Statement`

    - #### setVariableScope

          public void setVariableScope(VariableScope scope)

    - #### getVariableScope

          public VariableScope getVariableScope()