Package org.fife.rsta.ac.java.rjc.ast
Interface TypeDeclaration
-
- All Superinterfaces:
ASTNode,TypeDeclarationContainer
- All Known Implementing Classes:
AbstractTypeDeclarationNode,EnumDeclaration,NormalClassDeclaration,NormalInterfaceDeclaration
public interface TypeDeclaration extends ASTNode, TypeDeclarationContainer
A type declaration.- Version:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleangetBodyContainsOffset(int offs)Returns whether this type declaration contains the specified offset.intgetBodyEndOffset()Returns the end-offset of the type declaration's body.intgetBodyStartOffset()Returns the start-offset of the type declaration's body.TypeDeclarationgetChildType(int index)Returns a child type by index.TypeDeclarationgetChildTypeAtOffset(int offs)Returns the child type declaration of this one that contains the specified offset, if any.intgetChildTypeCount()Returns the number of child types.java.lang.StringgetDocComment()Returns the doc comment for this type declaration.java.util.Iterator<Field>getFieldIterator()Returns an iterator over all fields defined in this type.MembergetMember(int index)Returns a member by index.intgetMemberCount()Returns the number of members in this type declaration.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.ModifiersgetModifiers()Returns the modifiers of this type declaration.java.lang.StringgetName()Returns the name of this type, unqualified.java.lang.StringgetName(boolean fullyQualified)Returns the name of this type.PackagegetPackage()Returns the package this type is in.TypeDeclarationgetParentType()Returns the parent type declaration.java.lang.StringgetTypeString()Returns the type of this type declaration, as a string.booleanisDeprecated()Returns whether this type declaration is deprecated.booleanisStatic()Shortcut forgetModifiers().isStatic(); useful sincegetModifiers()may returnnull.voidsetDocComment(java.lang.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 org.fife.rsta.ac.java.rjc.ast.ASTNode
getNameEndOffset, getNameStartOffset
-
Methods inherited from interface org.fife.rsta.ac.java.rjc.ast.TypeDeclarationContainer
addTypeDeclaration
-
-
-
-
Method Detail
-
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()
-
getBodyStartOffset
int getBodyStartOffset()
Returns the start-offset of the type declaration's body.- Returns:
- The start offset.
- See Also:
getBodyEndOffset()
-
getChildType
TypeDeclaration getChildType(int index)
Returns a child type by index.- Parameters:
index- The index.- Returns:
- The child type.
- See Also:
getChildTypeCount()
-
getChildTypeAtOffset
TypeDeclaration getChildTypeAtOffset(int offs)
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:
getChildType(int)
-
getDocComment
java.lang.String getDocComment()
Returns the doc comment for this type declaration.- Returns:
- The doc comment.
- See Also:
setDocComment(String)
-
getFieldIterator
java.util.Iterator<Field> getFieldIterator()
Returns an iterator over all fields defined in this type.- Returns:
- The iterator.
- See Also:
getMethodIterator(),getMemberIterator()
-
getMember
Member getMember(int index)
Returns a member by index.- Parameters:
index- The index.- Returns:
- The member.
- See Also:
getMemberCount(),getMemberIterator()
-
getMemberCount
int getMemberCount()
Returns the number of members in this type declaration.- Returns:
- The number of members.
- See Also:
getMember(int),getMemberIterator()
-
getMemberIterator
java.util.Iterator<Member> getMemberIterator()
Returns an iterator over all members of this type. Note that an exception may be thrown if a method is added to this type while this iterator is being used.- Returns:
- The iterator.
- See Also:
getMethodIterator(),getMember(int),getMemberCount()
-
getMethodIterator
java.util.Iterator<Method> getMethodIterator()
Returns an iterator over all methods defined in this type.- Returns:
- The iterator.
- See Also:
getFieldIterator(),getMemberIterator()
-
getMethodsByName
java.util.List<Method> getMethodsByName(java.lang.String name)
Returns all methods declared in this type with the given name. Does not check for methods with this name in subclasses.- Parameters:
name- The name to check for.- Returns:
- Any method overloads with that name, or an empty list if none.
-
getModifiers
Modifiers getModifiers()
Returns the modifiers of this type declaration.- Returns:
- The modifier list. This may be
nullif no modifiers were specified.
-
getName
java.lang.String getName()
Returns the name of this type, unqualified.- Specified by:
getNamein interfaceASTNode- Returns:
- The name of this type.
- See Also:
getName(boolean)
-
getName
java.lang.String getName(boolean fullyQualified)
Returns the name of this type.- Parameters:
fullyQualified- Whether the name returned should be fully qualified.- Returns:
- The type's name.
- See Also:
getName()
-
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:
setParentType(TypeDeclaration)
-
getTypeString
java.lang.String getTypeString()
Returns the type of this type declaration, as a string.- Returns:
- The type.
-
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:
getModifiers()
-
setDocComment
void setDocComment(java.lang.String comment)
Sets the doc comment for this type declaration.- Parameters:
comment- The new doc comment.- See Also:
getDocComment()
-
setParentType
void setParentType(TypeDeclaration parentType)
Sets the parent type declaration for this type declaration.- Parameters:
parentType- The parent type declaration.- See Also:
getParentType()
-
-