Package de.intarsys.tools.functor
Class EmptyDeclarationBlock
- java.lang.Object
-
- de.intarsys.tools.functor.EmptyDeclarationBlock
-
- All Implemented Interfaces:
IDeclaration,IDeclarationBlock
public class EmptyDeclarationBlock extends java.lang.Object implements IDeclarationBlock
Helper implementation for an empty declaration block.
-
-
Constructor Summary
Constructors Constructor Description EmptyDeclarationBlock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFunctorCallaccept(IFunctorCall call)Apply this declaration tocall.java.lang.ObjectgetDeclarationContext()An optional declaration context.IDeclaration[]getDeclarations()The array ofIDeclarationinstances in this block.booleanisBlock()trueif this declaration has child elements itself.intsize()The number of declarations in this block.
-
-
-
Method Detail
-
accept
public IFunctorCall accept(IFunctorCall call) throws DeclarationException
Description copied from interface:IDeclarationApply this declaration tocall.The semantics of this method is up to the designer.
- Specified by:
acceptin interfaceIDeclaration- Parameters:
call- TheIFunctorCallto be modified.- Returns:
- The modified or new
IFunctorCall. - Throws:
DeclarationException
-
getDeclarationContext
public java.lang.Object getDeclarationContext()
Description copied from interface:IDeclarationAn optional declaration context. This may be for example the object that will launch theIFunctorCalllater and has parsed some declarations on startup.- Specified by:
getDeclarationContextin interfaceIDeclaration- Returns:
- An optional declaration context.
-
getDeclarations
public IDeclaration[] getDeclarations()
Description copied from interface:IDeclarationBlockThe array ofIDeclarationinstances in this block.- Specified by:
getDeclarationsin interfaceIDeclarationBlock- Returns:
- The array of
IDeclarationinstances in this block.
-
isBlock
public boolean isBlock()
Description copied from interface:IDeclarationtrueif this declaration has child elements itself.A
IDeclarationElementmay be aIDeclarationBlock, supporting nested declarations. You should not use "instanceof IDeclarationBlock" to check this behavior but this method.- Specified by:
isBlockin interfaceIDeclaration- Returns:
trueif this declaration has child elements itself.
-
size
public int size()
Description copied from interface:IDeclarationBlockThe number of declarations in this block.- Specified by:
sizein interfaceIDeclarationBlock- Returns:
- The number of declarations in this block.
-
-