org.inxar.jenesis
Interface Block

All Superinterfaces:
Codeable
All Known Subinterfaces:
Case, Catch, ClassMethod, ConditionalStatement, Constructor, Default, DoWhile, Else, ElseIf, Finally, For, If, InitializationDeclaration, LocalBlock, StaticInitializer, Switch, Synchronized, Try, While

public interface Block
extends Codeable

The Block superinterface. A Block is a structure that holds Statements and typically delimited by braces. Block acts as a factory for all Statement objects.


Method Summary
 Iterator getStatements()
          Gets the list of statements as an iterator of Statement.
 Break newBreak()
          Adds a new Break statement to this block and returns it.
 Continue newContinue()
          Adds a new Continue statement to this block and returns it.
 DoWhile newDoWhile(Expression predicate)
          Adds a new DoWhile statement to this block and returns it.
 Empty newEmpty()
          Adds a new Empty statement to this block and returns it.
 For newFor()
          Adds a new For statement to this block and returns it.
 If newIf(Expression predicate)
          Adds a new If statement to this block and returns it.
 Let newLet(Type type)
          Adds a new Let statement to this block for the given type and returns it.
 LocalBlock newLocalBlock()
          Adds a new LocalBlock statement to this block and returns it.
 LocalClass newLocalClass(java.lang.String name)
          Adds a new LocalClass statement to this block and returns it.
 Return newReturn()
          Adds a new Return statement to this block and returns it.
 ExpressionStatement newStmt(Expression expr)
          Adds a new ExpressionStatement statement to this block on the given statement Expression and returns it.
 Switch newSwitch(Expression integer)
          Adds a new Switch statement to this block and returns it.
 Synchronized newSynchronized(Expression mutex)
          Adds a new Synchronized statement to this block and returns it.
 Throw newThrow(Expression throwable)
          Adds a new Throw statement to this block and returns it.
 Try newTry()
          Adds a new Try statement to this block and returns it.
 While newWhile(Expression predicate)
          Adds a new While statement to this block and returns it.
 
Methods inherited from interface org.inxar.jenesis.Codeable
getComment, setComment, toCode, vm
 

Method Detail

getStatements

public Iterator getStatements()
Gets the list of statements as an iterator of Statement.

newEmpty

public Empty newEmpty()
Adds a new Empty statement to this block and returns it.

newLocalBlock

public LocalBlock newLocalBlock()
Adds a new LocalBlock statement to this block and returns it.

newLocalClass

public LocalClass newLocalClass(java.lang.String name)
Adds a new LocalClass statement to this block and returns it.

newBreak

public Break newBreak()
Adds a new Break statement to this block and returns it.

newContinue

public Continue newContinue()
Adds a new Continue statement to this block and returns it.

newReturn

public Return newReturn()
Adds a new Return statement to this block and returns it.

newLet

public Let newLet(Type type)
Adds a new Let statement to this block for the given type and returns it.

newThrow

public Throw newThrow(Expression throwable)
Adds a new Throw statement to this block and returns it.

newWhile

public While newWhile(Expression predicate)
Adds a new While statement to this block and returns it.

newDoWhile

public DoWhile newDoWhile(Expression predicate)
Adds a new DoWhile statement to this block and returns it.

newFor

public For newFor()
Adds a new For statement to this block and returns it.

newTry

public Try newTry()
Adds a new Try statement to this block and returns it.

newSwitch

public Switch newSwitch(Expression integer)
Adds a new Switch statement to this block and returns it.

newSynchronized

public Synchronized newSynchronized(Expression mutex)
Adds a new Synchronized statement to this block and returns it.

newIf

public If newIf(Expression predicate)
Adds a new If statement to this block and returns it.

newStmt

public ExpressionStatement newStmt(Expression expr)
Adds a new ExpressionStatement statement to this block on the given statement Expression and returns it.