Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.model.java.source.tree
Interface ClassT  view ClassT download ClassT.java

All Superinterfaces:
BlockElementT, HasModifiersT, HasNameT, MemberT, Tree

public interface ClassT
extends MemberT, HasNameT, BlockElementT

A type declaration. These include: "class" type, "interface" type, "enum" type, "annotation" type.


Nested Class Summary
static class ClassT.ClassKind
          An enumeration identifying which kind of type declaration this is.
 
Field Summary
static ClassT[] EMPTY_ARRAY
           
 
Method Summary
 ClassBodyT getClassBody()
          Gets the class body.
 java.util.List getDeclaredClasses()
          Gets the list of member class declarations.
 ClassT getDeclaredClasses(java.lang.String name)
          Gets the matching member class declarations.
 java.util.List getDeclaredConstructors()
          Gets the list of declared constructor declarations.
 java.util.List getDeclaredFieldDeclarations()
          Gets the list of declared field declarations, including enum constant declarations.
 FieldVariableT getDeclaredFieldVariable(java.lang.String name)
          Gets the matching declared field variable, null if none.
 java.util.Collection getDeclaredFieldVariables()
          Gets the collection of declared field variables, including enum constant variables.
 java.util.List getDeclaredInitializers()
          Gets the list of declared class initializers.
 java.util.List getDeclaredMembers()
          Gets the list of declared member declarations.
 java.util.List getDeclaredMethods()
          Gets the list of declared method (but not constructor) declarations.
 java.util.Collection getDeclaredMethods(java.lang.String name)
          Gets the collection of matching methods (but not constructor) declarations.
 java.util.List getInterfaces()
          Gets the list of declared interfaces.
 InterfacesT getInterfacesClause()
          Gets the interfaces declaration.
 MemberT getOwningMember()
          Gets the owning member declaration, null if none.
 PackageT getPackageDeclaration()
          Gets the owning package declaration, null if none..
 java.lang.String getPackageName()
          Gets the owning package name, empty if none.
 TypeReferenceT getSuperclass()
          Gets the declared superclass.
 SuperclassT getSuperclassClause()
          Gets the superclass declaration.
 ClassT.ClassKind getTypeKind()
          Identifies what kind of class declaration this is.
 java.util.List getTypeParameters()
          Gets the ordered list of type parameters declared on this class.
 boolean isAnnotation()
          True if this is an annotation type.
 boolean isAnonymous()
          True if this is an anonymous class declaration.
 boolean isClass()
          True if this is a class or an enum type.
 boolean isEnum()
          True if this is an enum type.
 boolean isExported()
           
 boolean isInnerClass()
          True if this is an inner class.
 boolean isInterface()
          True if this is an interface or an annotation type.
 void setSuperclass(TypeReferenceT superclass)
          Attempts to set the declared base class of this class.
 void setTypeKind(ClassT.ClassKind typeKind)
          Attempts to change the type of class this is.
 
Methods inherited from interface javax.ide.model.java.source.tree.MemberT
getBlock, getDeclaringClass, getDocComment, setBlock, setDocComment
 
Methods inherited from interface javax.ide.model.java.source.tree.Tree
accept, accept, addSelf, addSelf, addSelfAfter, addSelfBefore, clearProperty, cloneSelf, getChildren, getOwningFile, getParent, getPosition, getProperty, getSiblingAfter, getSiblingBefore, getSiblings, getTreeKind, isSynthetic, removeSelf, replaceSelf, setProperty
 
Methods inherited from interface javax.ide.model.java.source.tree.HasModifiersT
addModifiers, getAnnotations, getModifiers, isAbstract, isFinal, isPrivate, isProtected, isPublic, isStatic, isStrictfp, removeModifiers, setModifiers
 
Methods inherited from interface javax.ide.model.java.source.tree.HasNameT
getName, getNameElement, setName, setNameElement
 

Field Detail

EMPTY_ARRAY

public static final ClassT[] EMPTY_ARRAY
Method Detail

getTypeKind

public ClassT.ClassKind getTypeKind()
Identifies what kind of class declaration this is.


setTypeKind

public void setTypeKind(ClassT.ClassKind typeKind)
Attempts to change the type of class this is.
 TY_CLASS: "class".
 TY_ENUM: "enum".
 TY_INTERFACE: "interface".
 TY_ANNOTATE: "@interface".


isClass

public boolean isClass()
True if this is a class or an enum type. Backward compatible. Checks against the presence of ACC_INTERFACE.


isInterface

public boolean isInterface()
True if this is an interface or an annotation type. Backward compatible. Checks for the presence of ACC_INTERFACE.


isEnum

public boolean isEnum()
True if this is an enum type. Checks for the presence of ACC_ENUM.


isAnnotation

public boolean isAnnotation()
True if this is an annotation type. Checks for the presence of ACC_ANNOTATION.


getPackageDeclaration

public PackageT getPackageDeclaration()
Gets the owning package declaration, null if none.. This amounts to calling getOwningSourceFile().getPackage().


getPackageName

public java.lang.String getPackageName()
Gets the owning package name, empty if none. Provided for convenience. This amounts to calling getOwningSourceFile().getPackageName().


isInnerClass

public boolean isInnerClass()
True if this is an inner class. Member, local, and anonymous classes are all considered to be inner classes.


isExported

public boolean isExported()

isAnonymous

public boolean isAnonymous()
True if this is an anonymous class declaration.


getSuperclassClause

public SuperclassT getSuperclassClause()
Gets the superclass declaration. On a "class" type, this will be the "extends" clause.


getInterfacesClause

public InterfacesT getInterfacesClause()
Gets the interfaces declaration. On a "class" or "enum" type, this will be the "implements" clause. On an "interface" type, this will be the "extends" clause.


getClassBody

public ClassBodyT getClassBody()
Gets the class body.


getTypeParameters

public java.util.List getTypeParameters()
Gets the ordered list of type parameters declared on this class. Remember, type parameters are not inherited by subclasses (and subinterfaces).

For classes, syntax is "javadoc mods class name {}".


getSuperclass

public TypeReferenceT getSuperclass()
Gets the declared superclass. On a "class" type, this will be the "extends" type.


setSuperclass

public void setSuperclass(TypeReferenceT superclass)
Attempts to set the declared base class of this class.


getInterfaces

public java.util.List getInterfaces()
Gets the list of declared interfaces. Do not confuse this with inner classes that are "interface" types. The name was chosen to be consistent with JavaType and java/lang/Class.

On a "class" or "enum" type, this will be the "implements" types. On an "interface" type, this will be the "extends" types.


getDeclaredMembers

public java.util.List getDeclaredMembers()
Gets the list of declared member declarations.


getDeclaredFieldDeclarations

public java.util.List getDeclaredFieldDeclarations()
Gets the list of declared field declarations, including enum constant declarations.


getDeclaredFieldVariables

public java.util.Collection getDeclaredFieldVariables()
Gets the collection of declared field variables, including enum constant variables.


getDeclaredFieldVariable

public FieldVariableT getDeclaredFieldVariable(java.lang.String name)
Gets the matching declared field variable, null if none.


getDeclaredMethods

public java.util.List getDeclaredMethods()
Gets the list of declared method (but not constructor) declarations.


getDeclaredMethods

public java.util.Collection getDeclaredMethods(java.lang.String name)
Gets the collection of matching methods (but not constructor) declarations. This list will not be filtered according to method signature. In other words, if there are multiple methods listed with the same signature, this list will include them all.


getDeclaredConstructors

public java.util.List getDeclaredConstructors()
Gets the list of declared constructor declarations.


getDeclaredClasses

public java.util.List getDeclaredClasses()
Gets the list of member class declarations. To be clear, this list does not include local or anonymous classes.


getDeclaredClasses

public ClassT getDeclaredClasses(java.lang.String name)
Gets the matching member class declarations. To be clear, this will not return a local or anonymous class.


getDeclaredInitializers

public java.util.List getDeclaredInitializers()
Gets the list of declared class initializers. To be clear, this list does NOT include the implicit block elements generated for member variable initializers.


getOwningMember

public MemberT getOwningMember()
Gets the owning member declaration, null if none.

The Java VM spec 3rd ed requires that local and anonymous classes have an attribute specifying the enclosing method. At a source level, we'll return the owning member.