org.jboss.errai.codegen.builder.impl
Class BlockBuilderImpl<T>
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
blockStatement
protected final BlockStatement blockStatement
callback
protected final BuildCallback<T> callback
BlockBuilderImpl
public BlockBuilderImpl()
BlockBuilderImpl
public BlockBuilderImpl(BuildCallback<T> callback)
BlockBuilderImpl
public BlockBuilderImpl(BlockStatement blockStatement,
BuildCallback<T> callback)
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>
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.