public abstract class DeclarationElement extends Declaration implements IDeclarationElement, IDeclarationBlock
IDeclarationElement instances. This one has a
very simple implementation for modifiers. Only the presence of the modifier
string fragment in declared modifier string is checked.| Constructor and Description |
|---|
DeclarationElement(java.lang.Object declarationContext,
java.lang.String name,
java.lang.String modifiers) |
DeclarationElement(java.lang.Object declarationContext,
java.lang.String name,
java.lang.String modifiers,
IDeclaration[] nestedDeclarations) |
| Modifier and Type | Method and Description |
|---|---|
IDeclaration[] |
getDeclarations()
The array of
IDeclaration instances in this block. |
java.lang.String |
getName()
An optional name for the declaration element.
|
boolean |
hasModifier(java.lang.String modifier)
true if the declaration has the requested modifier. |
boolean |
isBlock()
true if this declaration has child elements itself. |
int |
size()
The number of declarations in this block.
|
java.lang.String |
toString() |
getDeclarationContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaccept, getDeclarationContextpublic DeclarationElement(java.lang.Object declarationContext,
java.lang.String name,
java.lang.String modifiers)
public DeclarationElement(java.lang.Object declarationContext,
java.lang.String name,
java.lang.String modifiers,
IDeclaration[] nestedDeclarations)
public IDeclaration[] getDeclarations()
IDeclarationBlockIDeclaration instances in this block.getDeclarations in interface IDeclarationBlockIDeclaration instances in this block.public java.lang.String getName()
IDeclarationElementgetName in interface IDeclarationElementpublic boolean hasModifier(java.lang.String modifier)
IDeclarationElementtrue if the declaration has the requested modifier.
An implementation is free to support modifiers and define their respective semantics.
An example for a modifier may be "persistent" to indicate the implementation should store argument values to be able to present them again in a later call (in a wizard for example).
hasModifier in interface IDeclarationElementmodifier - The modifier name.true if the declaration has the requested
modifier.public boolean isBlock()
IDeclarationtrue 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.
isBlock in interface IDeclarationisBlock in class Declarationtrue if this declaration has child elements
itself.public int size()
IDeclarationBlocksize in interface IDeclarationBlockpublic java.lang.String toString()
toString in class java.lang.Object