Package: org.codehaus.groovy.ast.stmt

## [Java] Class BlockStatement

- org.codehaus.groovy.ast.stmt.BlockStatement

- A list of statements and a scope.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `interface Statement` | `CLOSE_CURRENT_RESULT, KEEP_CURRENT_RESULT, CLOSE_ALL_RESULTS, SUCCESS_NO_INFO, EXECUTE_FAILED, RETURN_GENERATED_KEYS, NO_GENERATED_KEYS`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `VariableScope` | `variableScope`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `BlockStatement ()`
    `BlockStatement (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.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `addStatement(Statement statement)`
    `` | `void` | `addStatements(List<Statement> listOfStatements)`
    `` | `List<Statement>` | `getStatements()`
    `` | `String` | `getText()`
    `` | `VariableScope` | `getVariableScope()`
    `` | `boolean` | `isEmpty()`
    `` | `void` | `setVariableScope(VariableScope scope)`
    `` | `String` | `toString()`
    `` | `void` | `visit(GroovyCodeVisitor visitor)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `interface Statement` | `getConnection, isClosed, cancel, setEscapeProcessing, getResultSetConcurrency, getResultSetHoldability, isCloseOnCompletion, enquoteNCharLiteral, getLargeUpdateCount, clearWarnings, getFetchSize, getFetchDirection, getWarnings, setFetchDirection, setFetchSize, executeUpdate, executeUpdate, executeUpdate, executeUpdate, getMaxFieldSize, setMaxFieldSize, executeQuery, getMaxRows, clearBatch, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, executeLargeUpdate, setMaxRows, getResultSet, getMoreResults, getMoreResults, executeBatch, setLargeMaxRows, executeLargeBatch, setQueryTimeout, isSimpleIdentifier, setPoolable, enquoteIdentifier, getLargeMaxRows, setCursorName, getResultSetType, enquoteLiteral, closeOnCompletion, getQueryTimeout, getUpdateCount, isPoolable, addBatch, getGeneratedKeys, execute, execute, execute, execute, close, isWrapperFor, unwrap`
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Property Detail

    - #### VariableScope variableScope

  - ### Constructor Detail

    - #### public BlockStatement()

    - #### public BlockStatement(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

    - #### 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

    - #### public void addStatement(Statement statement)

    - #### public void addStatements(List<Statement> listOfStatements)

    - #### public List<Statement> getStatements()

    - #### public String getText()

    - #### public VariableScope getVariableScope()

    - #### public boolean isEmpty()

    - #### public void setVariableScope(VariableScope scope)

    - #### public String toString()

    - #### public void visit(GroovyCodeVisitor visitor)