Errai 3.0.1-SNAPSHOT

org.jboss.errai.codegen.builder.impl
Class BlockBuilderImpl<T>

java.lang.Object
  extended by org.jboss.errai.codegen.builder.impl.BlockBuilderImpl<T>
All Implemented Interfaces:
Iterable<Statement>, BlockBuilder<T>, Finishable<T>
Direct Known Subclasses:
ConstructorBlockBuilderImpl, MethodBlockBuilderImpl

public class BlockBuilderImpl<T>
extends Object
implements BlockBuilder<T>

Author:
Mike Brock , Christian Sadilek

Field Summary
protected  BlockStatement blockStatement
           
protected  BuildCallback<T> callback
           
 
Constructor Summary
BlockBuilderImpl()
           
BlockBuilderImpl(BlockStatement blockStatement, BuildCallback<T> callback)
           
BlockBuilderImpl(BuildCallback<T> callback)
           
 
Method Summary
 BlockBuilder<T> _(InnerClass innerClass)
          Alias for BlockBuilder.append(org.jboss.errai.codegen.InnerClass) )}
 BlockBuilder<T> _(Statement stmt)
          Alias for BlockBuilder.append(org.jboss.errai.codegen.Statement)
 BlockBuilder<T> append(InnerClass innerClass)
           
 BlockBuilder<T> append(Statement statement)
           
 BlockBuilder<T> appendAll(Collection<Statement> stmt)
           
 void clear()
           
 T finish()
           
 void insertBefore(InnerClass innerClass)
           
 void insertBefore(Statement stmt)
           
 Iterator<Statement> iterator()
           
 Statement peek()
          Show the last statement in the block.
 List<Statement> splitFrom(Statement statement)
          Return a list of statements from the specified statement (inclusive), and remove all of the returned statements from the underlying builder.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

blockStatement

protected final BlockStatement blockStatement

callback

protected final BuildCallback<T> callback
Constructor Detail

BlockBuilderImpl

public BlockBuilderImpl()

BlockBuilderImpl

public BlockBuilderImpl(BuildCallback<T> callback)

BlockBuilderImpl

public BlockBuilderImpl(BlockStatement blockStatement,
                        BuildCallback<T> callback)
Method Detail

insertBefore

public void insertBefore(Statement stmt)
Specified by:
insertBefore in interface BlockBuilder<T>

insertBefore

public void insertBefore(InnerClass innerClass)
Specified by:
insertBefore in interface BlockBuilder<T>

append

public BlockBuilder<T> append(Statement statement)
Specified by:
append in interface BlockBuilder<T>

appendAll

public BlockBuilder<T> appendAll(Collection<Statement> stmt)
Specified by:
appendAll in interface BlockBuilder<T>

append

public BlockBuilder<T> append(InnerClass innerClass)
Specified by:
append in interface BlockBuilder<T>

_

public BlockBuilder<T> _(Statement stmt)
Description copied from interface: BlockBuilder
Alias for BlockBuilder.append(org.jboss.errai.codegen.Statement)

Specified by:
_ in interface BlockBuilder<T>
Parameters:
stmt - the statement to add to the block
Returns:

_

public BlockBuilder<T> _(InnerClass innerClass)
Description copied from interface: BlockBuilder
Alias for BlockBuilder.append(org.jboss.errai.codegen.InnerClass) )}

Specified by:
_ in interface BlockBuilder<T>
Parameters:
innerClass - the statement to add to the block
Returns:

splitFrom

public List<Statement> splitFrom(Statement statement)
Description copied from interface: BlockBuilder
Return a list of statements from the specified statement (inclusive), and remove all of the returned statements from the underlying builder.

Specified by:
splitFrom in interface BlockBuilder<T>
Parameters:
statement - the statement to split from.
Returns:
a list of statements from the specified statement

peek

public Statement peek()
Description copied from interface: BlockBuilder
Show the last statement in the block.

Specified by:
peek in interface BlockBuilder<T>
Returns:
the last statement in the block.

iterator

public Iterator<Statement> iterator()
Specified by:
iterator in interface Iterable<Statement>

finish

public T finish()
Specified by:
finish in interface Finishable<T>

clear

public void clear()
Specified by:
clear in interface BlockBuilder<T>

Errai 3.0.1-SNAPSHOT

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