Top Description Fields Constructors Methods
org.codehaus.groovy.ast.stmt

public Class BlockStatement

extends Statement
Class Inheritance
Imports
org.codehaus.groovy.ast.GroovyCodeVisitor, .VariableScope, java.util.ArrayList, .Arrays, .List

A list of statements and a scope.

Field Summary

Modifier and TypeField and Description
private VariableScope
private List<Statement>

Constructor Summary

AccessConstructor and Description
public
public
BlockStatement(List<Statement>
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.
statements
,
VariableScope
the scope
scope
)

Creates a BlockStatement with a scope and children statements.

public
BlockStatement(Statement[]
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.
statements
,
VariableScope
the scope
scope
)

Creates a BlockStatement with a scope and children statements.

Method Summary

Modifier and TypeMethod and Description
public void
public void
addStatements(List<Statement> listOfStatements)

public List<Statement>
public String
public VariableScope
public boolean
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public void
Inherited from org.codehaus.groovy.ast.stmt.Statement:
addStatementLabelcopyStatementLabelsgetStatementLabelgetStatementLabelssetStatementLabel

Field Detail

scopeback to summary
private VariableScope scope
statementsback to summary
private List<Statement> statements

Constructor Detail

BlockStatementback to summary
public BlockStatement()
BlockStatementback to summary
public BlockStatement(List<Statement> statements, VariableScope scope)

Creates a BlockStatement with a scope and children statements.

Parameters
statements:List<Statement>

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:VariableScope

the scope

BlockStatementback to summary
public BlockStatement(Statement[] statements, VariableScope scope)

Creates a BlockStatement with a scope and children statements.

Parameters
statements:Statement[]

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:VariableScope

the scope

Method Detail

addStatementback to summary
public void addStatement(Statement statement)
addStatementsback to summary
public void addStatements(List<Statement> listOfStatements)
getStatementsback to summary
public List<Statement> getStatements()
getTextback to summary
public String getText()

Overrides org.codehaus.groovy.ast.ASTNode.getText.

getVariableScopeback to summary
public VariableScope getVariableScope()
isEmptyback to summary
public boolean isEmpty()

Overrides org.codehaus.groovy.ast.stmt.Statement.isEmpty.

setVariableScopeback to summary
public void setVariableScope(VariableScope scope)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

visitback to summary
public void visit(GroovyCodeVisitor visitor)

Overrides org.codehaus.groovy.ast.ASTNode.visit.