Interface TypeDeclaration
- All Superinterfaces:
ASTNode, TypeDeclarationContainer
- All Known Implementing Classes:
AbstractTypeDeclarationNode, EnumDeclaration, NormalClassDeclaration, NormalInterfaceDeclaration
A type declaration.
- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionbooleangetBodyContainsOffset(int offs) Returns whether this type declaration contains the specified offset.intReturns the end-offset of the type declaration's body.intReturns the start-offset of the type declaration's body.getChildType(int index) Returns a child type by index.getChildTypeAtOffset(int offs) Returns the child type declaration of this one that contains the specified offset, if any.intReturns the number of child types.Returns the doc comment for this type declaration.Returns an iterator over all fields defined in this type.getMember(int index) Returns a member by index.intReturns the number of members in this type declaration.Returns an iterator over all members of this type.Returns an iterator over all methods defined in this type.getMethodsByName(String name) Returns all methods declared in this type with the given name.Returns the modifiers of this type declaration.getName()Returns the name of this type, unqualified.getName(boolean fullyQualified) Returns the name of this type.Returns the package this type is in.Returns the parent type declaration.Returns the type of this type declaration, as a string.booleanReturns whether this type declaration is deprecated.booleanisStatic()Shortcut forgetModifiers().isStatic(); useful sincegetModifiers()may returnnull.voidsetDocComment(String comment) Sets the doc comment for this type declaration.voidsetParentType(TypeDeclaration parentType) Sets the parent type declaration for this type declaration.Methods inherited from interface ASTNode
getNameEndOffset, getNameStartOffsetMethods inherited from interface TypeDeclarationContainer
addTypeDeclaration
-
Method Details
-
getBodyContainsOffset
boolean getBodyContainsOffset(int offs) Returns whether this type declaration contains the specified offset.- Parameters:
offs- The offset to check.- Returns:
- Whether the offset is contained.
-
getBodyEndOffset
int getBodyEndOffset()Returns the end-offset of the type declaration's body.- Returns:
- The end offset.
- See Also:
-
getBodyStartOffset
int getBodyStartOffset()Returns the start-offset of the type declaration's body.- Returns:
- The start offset.
- See Also:
-
getChildType
Returns a child type by index.- Parameters:
index- The index.- Returns:
- The child type.
- See Also:
-
getChildTypeAtOffset
Returns the child type declaration of this one that contains the specified offset, if any.- Parameters:
offs- The offset.- Returns:
- The type declaration, or
nullif the offset is outside any child type declaration.
-
getChildTypeCount
int getChildTypeCount()Returns the number of child types.- Returns:
- The number of child types.
- See Also:
-
getDocComment
String getDocComment()Returns the doc comment for this type declaration.- Returns:
- The doc comment.
- See Also:
-
getFieldIterator
-
getMember
Returns a member by index.- Parameters:
index- The index.- Returns:
- The member.
- See Also:
-
getMemberCount
int getMemberCount()Returns the number of members in this type declaration.- Returns:
- The number of members.
- See Also:
-
getMemberIterator
-
getMethodIterator
-
getMethodsByName
-
getModifiers
Modifiers getModifiers()Returns the modifiers of this type declaration.- Returns:
- The modifier list. This may be
nullif no modifiers were specified.
-
getName
-
getName
Returns the name of this type.- Parameters:
fullyQualified- Whether the name returned should be fully qualified.- Returns:
- The type's name.
- See Also:
-
getPackage
Package getPackage()Returns the package this type is in.- Returns:
- The package, or
nullif it's in the default package.
-
getParentType
TypeDeclaration getParentType()Returns the parent type declaration.- Returns:
- The parent type declaration, or
nullif there isn't one. - See Also:
-
getTypeString
-
isDeprecated
boolean isDeprecated()Returns whether this type declaration is deprecated.- Returns:
- Whether this type declaration is deprecated.
-
isStatic
boolean isStatic()Shortcut forgetModifiers().isStatic(); useful sincegetModifiers()may returnnull.- Returns:
- Whether this type declaration is static.
- See Also:
-
setDocComment
Sets the doc comment for this type declaration.- Parameters:
comment- The new doc comment.- See Also:
-
setParentType
Sets the parent type declaration for this type declaration.- Parameters:
parentType- The parent type declaration.- See Also:
-