de.intarsys.tools.functor
Class DeclarationBlock
java.lang.Object
de.intarsys.tools.functor.Declaration
de.intarsys.tools.functor.DeclarationBlock
- All Implemented Interfaces:
- IDeclaration, IDeclarationBlock
public class DeclarationBlock
- extends Declaration
- implements IDeclarationBlock
A generic implementation for IDeclarationBlock
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EMPTY
public static final IDeclarationBlock EMPTY
DeclarationBlock
public DeclarationBlock(java.lang.Object declarationContext)
DeclarationBlock
public DeclarationBlock(java.lang.Object declarationContext,
IDeclaration[] declarations)
accept
public IFunctorCall accept(IFunctorCall call)
throws DeclarationException
- Description copied from interface:
IDeclaration
- Apply this declaration to
call
.
The semantics of this method is up to the designer.
- Specified by:
accept
in interface IDeclaration
- Parameters:
call
- The IFunctorCall
to be modified.
- Returns:
- The modified or new
IFunctorCall
.
- Throws:
DeclarationException
addDeclaration
public void addDeclaration(IDeclaration declaration)
getDeclarations
public IDeclaration[] getDeclarations()
- Description copied from interface:
IDeclarationBlock
- The array of
IDeclaration
instances in this block.
- Specified by:
getDeclarations
in interface IDeclarationBlock
- Returns:
- The array of
IDeclaration
instances in this block.
isBlock
public boolean isBlock()
- Description copied from interface:
IDeclaration
true
if this declaration has child elements itself.
A IDeclarationElement
may be a IDeclarationBlock
,
supporting nested declarations. You should not use "instanceof
IDeclarationBlock" to check this behavior but this method.
- Specified by:
isBlock
in interface IDeclaration
- Overrides:
isBlock
in class Declaration
- Returns:
true
if this declaration has child elements
itself.
removeDeclaration
public boolean removeDeclaration(IDeclaration declaration)
size
public int size()
- Description copied from interface:
IDeclarationBlock
- The number of declarations in this block.
- Specified by:
size
in interface IDeclarationBlock
- Returns:
- The number of declarations in this block.