Errai 3.0.1-SNAPSHOT

org.jboss.errai.codegen
Class BlockStatement

java.lang.Object
  extended by org.jboss.errai.codegen.AbstractStatement
      extended by org.jboss.errai.codegen.BlockStatement
All Implemented Interfaces:
Statement

public class BlockStatement
extends AbstractStatement

Represents a code block (e.g. a loop body).

Author:
Christian Sadilek

Field Summary
static BlockStatement EMPTY_BLOCK
           
 
Constructor Summary
BlockStatement(Statement... statements)
           
 
Method Summary
 BlockStatement addAllStatements(Collection<Statement> stmts)
           
 BlockStatement addStatement(Statement statement)
           
 String generate(Context context)
           
 List<Statement> getStatements()
          Returns a mutable representation of the statements in this block.
 void insertBefore(Statement statement)
           
 boolean isEmpty()
           
 
Methods inherited from class org.jboss.errai.codegen.AbstractStatement
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_BLOCK

public static final BlockStatement EMPTY_BLOCK
Constructor Detail

BlockStatement

public BlockStatement(Statement... statements)
Method Detail

addStatement

public BlockStatement addStatement(Statement statement)

addAllStatements

public BlockStatement addAllStatements(Collection<Statement> stmts)

insertBefore

public void insertBefore(Statement statement)

generate

public String generate(Context context)

getStatements

public List<Statement> getStatements()
Returns a mutable representation of the statements in this block. Changes to the List returned by this method will be reflected in the state of this method when the code is generated.

Returns:
a list representing the underlying set of statements in this block.

isEmpty

public boolean isEmpty()

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.