Package de.intarsys.tools.functor
Class DeclarationBlock
java.lang.Object
de.intarsys.tools.functor.Declaration
de.intarsys.tools.functor.DeclarationBlock
- All Implemented Interfaces:
IDeclaration
,IDeclarationBlock
A generic implementation for
IDeclarationBlock
.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDeclarationBlock
(Object declarationContext) DeclarationBlock
(Object declarationContext, IDeclaration[] declarations) -
Method Summary
Modifier and TypeMethodDescriptionaccept
(IFunctorCall call) Apply this declaration tocall
.void
addDeclaration
(IDeclaration declaration) The array ofIDeclaration
instances in this block.boolean
isBlock()
true
if this declaration has child elements itself.boolean
removeDeclaration
(IDeclaration declaration) int
size()
The number of declarations in this block.Methods inherited from class de.intarsys.tools.functor.Declaration
getDeclarationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.intarsys.tools.functor.IDeclaration
getDeclarationContext
-
Field Details
-
EMPTY
-
-
Constructor Details
-
DeclarationBlock
-
DeclarationBlock
-
-
Method Details
-
accept
Description copied from interface:IDeclaration
Apply this declaration tocall
.The semantics of this method is up to the designer.
- Specified by:
accept
in interfaceIDeclaration
- Parameters:
call
- TheIFunctorCall
to be modified.- Returns:
- The modified or new
IFunctorCall
. - Throws:
DeclarationException
-
addDeclaration
-
getDeclarations
Description copied from interface:IDeclarationBlock
The array ofIDeclaration
instances in this block.- Specified by:
getDeclarations
in interfaceIDeclarationBlock
- 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 aIDeclarationBlock
, supporting nested declarations. You should not use "instanceof IDeclarationBlock" to check this behavior but this method.- Specified by:
isBlock
in interfaceIDeclaration
- Overrides:
isBlock
in classDeclaration
- Returns:
true
if this declaration has child elements itself.
-
removeDeclaration
-
size
public int size()Description copied from interface:IDeclarationBlock
The number of declarations in this block.- Specified by:
size
in interfaceIDeclarationBlock
- Returns:
- The number of declarations in this block.
-