Package 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 SummaryConstructors Constructor 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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStatement(Statement statement)voidaddStatements(java.util.List<Statement> listOfStatements)java.util.List<Statement>getStatements()java.lang.StringgetText()VariableScopegetVariableScope()booleanisEmpty()voidsetVariableScope(VariableScope scope)java.lang.StringtoString()voidvisit(GroovyCodeVisitor visitor)- 
Methods inherited from class org.codehaus.groovy.ast.stmt.StatementaddStatementLabel, getStatementLabel, getStatementLabels, setStatementLabel
 - 
Methods inherited from class org.codehaus.groovy.ast.ASTNodecopyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, getNodeMetaData, getNodeMetaData, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition
 
- 
 
- 
- 
- 
Constructor Detail- 
BlockStatementpublic BlockStatement() 
 - 
BlockStatementpublic 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
 
 - 
BlockStatementpublic 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- 
visitpublic void visit(GroovyCodeVisitor visitor) 
 - 
getStatementspublic java.util.List<Statement> getStatements() 
 - 
addStatementpublic void addStatement(Statement statement) 
 - 
addStatementspublic void addStatements(java.util.List<Statement> listOfStatements) 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
setVariableScopepublic void setVariableScope(VariableScope scope) 
 - 
getVariableScopepublic VariableScope getVariableScope() 
 
- 
 
-