public abstract class AbstractTypeDeclarationNode extends java.lang.Object implements TypeDeclaration
| Constructor and Description |
|---|
AbstractTypeDeclarationNode(java.lang.String name,
Offset start) |
AbstractTypeDeclarationNode(java.lang.String name,
Offset start,
Offset end) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMember(Member member) |
void |
addTypeDeclaration(TypeDeclaration type) |
boolean |
getBodyContainsOffset(int offs) |
int |
getBodyEndOffset() |
int |
getBodyStartOffset() |
TypeDeclaration |
getChildType(int index) |
TypeDeclaration |
getChildTypeAtOffset(int offs)
Returns the child type declaration of this one that contains the
specified offset, if any.
|
int |
getChildTypeCount() |
java.lang.String |
getDocComment() |
java.util.Iterator<Field> |
getFieldIterator()
Returns an iterator over all fields defined in this type.
|
Member |
getMember(int index) |
int |
getMemberCount() |
java.util.Iterator<Member> |
getMemberIterator()
Returns an iterator over all members of this type.
|
java.util.Iterator<Method> |
getMethodIterator()
Returns an iterator over all methods defined in this type.
|
java.util.List<Method> |
getMethodsByName(java.lang.String name)
Returns all methods declared in this type with the given name.
|
Modifiers |
getModifiers()
Returns the modifiers of this type declaration.
|
java.lang.String |
getName()
Returns the "name" of this node.
|
java.lang.String |
getName(boolean fullyQualified)
Returns the name of this type.
|
int |
getNameEndOffset()
Returns the end offset of the "name" of this node.
|
int |
getNameStartOffset()
Returns the start offset of the "name" of this node.
|
Package |
getPackage()
Returns the package this type is in.
|
TypeDeclaration |
getParentType()
Returns the parent type declaration.
|
boolean |
isDeprecated() |
boolean |
isStatic()
Shortcut for
getModifiers().isStatic(); useful since
getModifiers() may return null. |
void |
setBodyEndOffset(Offset end) |
void |
setBodyStartOffset(Offset start) |
void |
setDeclarationEndOffset(Offset end) |
protected void |
setDeclarationOffsets(Offset start,
Offset end)
Sets the start and end offsets of this node.
|
void |
setDeprecated(boolean deprecated) |
void |
setDocComment(java.lang.String comment) |
void |
setModifiers(Modifiers modifiers) |
void |
setPackage(Package pkg)
Sets the package this type is in.
|
void |
setParentType(TypeDeclaration parentType)
Sets the parent type declaration for this type declaration.
|
java.lang.String |
toString()
Returns the name of this node (e.g.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetName, getTypeStringgetNameEndOffset, getNameStartOffsetpublic AbstractTypeDeclarationNode(java.lang.String name,
Offset start)
public void addMember(Member member)
public void addTypeDeclaration(TypeDeclaration type)
addTypeDeclaration in interface TypeDeclarationContainerpublic boolean getBodyContainsOffset(int offs)
getBodyContainsOffset in interface TypeDeclarationpublic int getBodyEndOffset()
getBodyEndOffset in interface TypeDeclarationpublic int getBodyStartOffset()
getBodyStartOffset in interface TypeDeclarationpublic TypeDeclaration getChildType(int index)
getChildType in interface TypeDeclarationpublic TypeDeclaration getChildTypeAtOffset(int offs)
getChildTypeAtOffset in interface TypeDeclarationoffs - The offset.null if the offset is
outside of any child type declaration.public int getChildTypeCount()
getChildTypeCount in interface TypeDeclarationpublic java.lang.String getDocComment()
getDocComment in interface TypeDeclarationpublic java.util.Iterator<Field> getFieldIterator()
getFieldIterator in interface TypeDeclarationTypeDeclaration.getMethodIterator(),
TypeDeclaration.getMemberIterator()public Member getMember(int index)
getMember in interface TypeDeclarationpublic int getMemberCount()
getMemberCount in interface TypeDeclarationpublic java.util.Iterator<Member> getMemberIterator()
getMemberIterator in interface TypeDeclarationTypeDeclaration.getMethodIterator()public java.util.Iterator<Method> getMethodIterator()
getMethodIterator in interface TypeDeclarationTypeDeclaration.getFieldIterator(),
TypeDeclaration.getMemberIterator()public java.util.List<Method> getMethodsByName(java.lang.String name)
getMethodsByName in interface TypeDeclarationname - The name to check for.public Modifiers getModifiers()
TypeDeclarationgetModifiers in interface TypeDeclarationnull if no
modifiers were specified.public java.lang.String getName(boolean fullyQualified)
getName in interface TypeDeclarationfullyQualified - Whether the name returned should be fully
qualified.TypeDeclaration.getName()public Package getPackage()
getPackage in interface TypeDeclarationnull if it's in the default package.public TypeDeclaration getParentType()
getParentType in interface TypeDeclarationnull if there isn't
one.TypeDeclaration.setParentType(TypeDeclaration)public boolean isDeprecated()
isDeprecated in interface TypeDeclarationpublic boolean isStatic()
getModifiers().isStatic(); useful since
getModifiers() may return null.isStatic in interface TypeDeclarationTypeDeclaration.getModifiers()public void setBodyEndOffset(Offset end)
public void setBodyStartOffset(Offset start)
public void setDeprecated(boolean deprecated)
public void setDocComment(java.lang.String comment)
setDocComment in interface TypeDeclarationpublic void setModifiers(Modifiers modifiers)
public void setPackage(Package pkg)
pkg - The package, or null if this is in the
default package.getPackage()public void setParentType(TypeDeclaration parentType)
setParentType in interface TypeDeclarationparentType - The parent type declaration.TypeDeclaration.getParentType()public java.lang.String toString()
getName().
Subclasses can override this method if appropriate.public java.lang.String getName()
CodeBlocks
it will be CodeBlock.NAME.Note that this may not be unique. For example, a class with an overloaded method will have multiple methods with the same "name," just with different signatures.
public int getNameEndOffset()
getNameEndOffset in interface ASTNodepublic int getNameStartOffset()
getNameStartOffset in interface ASTNodepublic void setDeclarationEndOffset(Offset end)