Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.10
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.ast.stmt
[Java] 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.

Authors:
  James Strachan

Version:
  \$Revision: 21289 \$

Constructor Summary
`BlockStatement()`
`BlockStatement(List 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
`void` | `addStatement(Statement statement)`
`void` | `addStatements(List listOfStatements)`
`List` | `getStatements()`
`String` | `getText()`
`VariableScope` | `getVariableScope()`
`boolean` | `isEmpty()`
`void` | `setVariableScope(VariableScope scope)`
`String` | `toString()`
`void` | `visit(GroovyCodeVisitor visitor)`

Methods inherited from class Statement
getStatementLabel, isEmpty, setStatementLabel

Methods inherited from class ASTNode
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, getText, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Constructor Detail

### BlockStatement

    public BlockStatement()

### BlockStatement

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

### addStatement

    public void addStatement(Statement statement)

### addStatements

    public void addStatements(List listOfStatements)

### getStatements

    public List getStatements()

### getText

    public String getText()

### getVariableScope

    public VariableScope getVariableScope()

### isEmpty

    public boolean isEmpty()

### setVariableScope

    public void setVariableScope(VariableScope scope)

### toString

    public String toString()

### visit

    public void visit(GroovyCodeVisitor visitor)

Copyright © 2003-2010 The Codehaus. All rights reserved.