public interface SourceClass extends SourceMember, SourceHasName, SourceBlockElement, JavaClass
| Modifier and Type | Field and Description | 
|---|---|
static SourceClass[] | 
EMPTY_ARRAY  | 
static int | 
PRINT_DECLARATION
"modifiers class name<type_parameters extends bounds, ...>" 
 | 
static int | 
PRINT_NAME
"name<type_parameters, ...>" 
 | 
static int | 
PRINT_NAME_AND_PARAMETERS
"name<type_parameters extends bounds, ...>" 
 | 
CHILDREN_ALL, CHILDREN_BLANKLINES, CHILDREN_COMMENTS, CHILDREN_default, CHILDREN_none, CHILDREN_REGULAR, PRINT_ALL, REFORMAT_ALL, REFORMAT_INDENT| Modifier and Type | Method and Description | 
|---|---|
SourceInterfacesClause | 
getInterfacesClause()
Gets the extends/implements clause object. 
 | 
SourceMember | 
getOwningMember()
Gets the owning member declaration, null if none. 
 | 
java.lang.String | 
getPackageName()
Gets the owning package name, empty if none. 
 | 
java.util.List<SourceClass> | 
getSourceAnonymousClasses()
Gets the list of anonymous class declarations, where the enclosing class of those anonymous classes is this SourceClass. 
 | 
SourceClassBody | 
getSourceBody()
Gets the class body object. 
 | 
SourceClass | 
getSourceClass(java.lang.String name)
Gets the member class with the incoming name. 
 | 
java.util.List<SourceClass> | 
getSourceClasses()
Gets the list of member class declarations. 
 | 
SourceMethod | 
getSourceConstructor(JavaType[] targetTypes)
Gets the matching declared constructor declaration, null if none. 
 | 
java.util.List<SourceMethod> | 
getSourceConstructors()
Gets the list of declared constructor declarations. 
 | 
java.util.List<SourceEnumConstant> | 
getSourceEnumConstants()
Gets the list of declared enum constants. 
 | 
java.util.List<SourceFieldDeclaration> | 
getSourceFieldDeclarations()
Gets the list of declared field declarations. 
 | 
SourceFieldVariable | 
getSourceFieldVariable(java.lang.String name)
Gets the matching declared field variable, null if none. 
 | 
java.util.Collection<SourceFieldVariable> | 
getSourceFieldVariables()
Gets the collection of declared field. 
 | 
java.util.List<SourceClassInitializer> | 
getSourceInitializers()
Gets the list of declared class initializers. 
 | 
java.util.List<SourceTypeReference> | 
getSourceInterfaces()
Gets the source superinterfaces. 
 | 
java.util.List<SourceClass> | 
getSourceLocalClasses()
Gets the list of local class declarations, where the enclosing class of those local classes is this SourceClass. 
 | 
java.util.List<SourceMember> | 
getSourceMembers()
Gets the list of declared member declarations. 
 | 
SourceMemberVariable | 
getSourceMemberVariable(java.lang.String name)
Gets the matching declared member variable, null if none. 
 | 
java.util.Collection<SourceMemberVariable> | 
getSourceMemberVariables()
Gets the list of all enum constants and field variables. 
 | 
SourceMethod | 
getSourceMethod(java.lang.String name, JavaType[] targetTypes)
Gets the matching method declaration, null if none. 
 | 
java.util.List<SourceMethod> | 
getSourceMethods()
Gets the list of declared method (but not constructor) declarations. 
 | 
java.util.Collection<SourceMethod> | 
getSourceMethods(java.lang.String name)
Gets the collection of matching method (but not constructor) declarations. 
 | 
SourcePackage | 
getSourcePackage()
Gets the owning package declaration. 
 | 
SourceTypeReference | 
getSourceSuperclass()
Gets the source superclass. 
 | 
java.util.List<SourceTypeParameter> | 
getSourceTypeParameters()
Gets the list of type parameters declared on this class. 
 | 
SourceSuperclassClause | 
getSuperclassClause()
Gets the extends/implements clause object. 
 | 
int | 
getTypeKind()
Identifies what kind of class declaration this is. 
 | 
boolean | 
isAnnotation()
True if this is an annotation type. 
 | 
boolean | 
isAnonymous()
Deprecated. 
 
Use JavaType.isAnonymousClass() instead. 
 | 
boolean | 
isClass()
True if this is a class or an enum type. 
 | 
boolean | 
isEnum()
True if this is an enum type. 
 | 
boolean | 
isExported()  | 
boolean | 
isInterface()
True if this is an interface or an annotation type. 
 | 
void | 
setSourceSuperclass(SourceTypeReference superclass)
Attempts to set the declared base class of this class. 
 | 
void | 
setTypeKind(int typeKind)
Attempts to change the type of class this is. 
 | 
getDocComment, getEnclosingClass, hasDeprecatedTag, hasHiddenTag, setDocCommentaddModifiers, getModifiers, getSourceAnnotations, removeModifiers, setModifiersaddSelf, addSelf, addSelfAfter, addSelfBefore, adjustTextIndentation, clearBinding, cloneSelf, compile, getBinding, getChildren, getChildren, getCompiledObject, getContainedElements, getEndOffset, getJdkVersion, getOwningFile, getOwningSourceFile, getParent, getSiblingAfter, getSiblingBefore, getSiblings, getSiblings, getStartOffset, getSymbolKind, getText, getTokens, hasErrors, print, print, reformatSelf, removeSelf, replaceSelf, resolve, setBinding, setContext, visitSelfgetName, getNameElement, setName, setNameElementclearCompiledInfoequals, getArrayDimensions, getBaseComponentType, getClass, getClasses, getClinitMethod, getClosestClass, getComponentType, getDeclaredAnonymousClasses, getDeclaredClass, getDeclaredClasses, getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredFields, getDeclaredLocalClasses, getDeclaredMethod, getDeclaredMethods, getDeclaredMethods, getDescriptor, getField, getFields, getHierarchy, getInterfaces, getMethod, getMethods, getMethods, getName, getPackage, getQualifiedName, getRawName, getSignature, getSuperclass, getThisValue, getTypeAnnotations, getTypeErasure, getTypeSignature, getUniqueIdentifier, getUnqualifiedName, getUnresolvedInterfaces, getUnresolvedSuperclass, getURL, getVMName, isAnonymousClass, isArray, isAssignableFrom, isErasedType, isLocalClass, isMemberClass, isPrimitive, isSubtypeOfgetActualTypeArguments, getTypeParameter, getTypeParameters, hasActualTypeArguments, hasTypeParametersgetOwningClass, isAbstract, isPackagePrivate, isPrivate, isProtected, isPublic, isStaticgetResolvedType, getUnresolvedTypegetAnnotation, getAnnotations, getDeclaredAnnotation, getDeclaredAnnotationsgetElementKind, getFile, getModifiers, getOwner, getSourceElement, isDeprecated, isFinal, isHidden, isSourceElement, isSynthetic, printCompiledInfostatic final SourceClass[] EMPTY_ARRAY
static final int PRINT_NAME
static final int PRINT_DECLARATION
static final int PRINT_NAME_AND_PARAMETERS
int getTypeKind()
TY_CLASS: "class". TY_ENUM: "enum". TY_INTERFACE: "interface". TY_ANNOTATE: "@interface".
void setTypeKind(int typeKind)
TY_CLASS: "class". TY_ENUM: "enum". TY_INTERFACE: "interface". TY_ANNOTATE: "@interface".
boolean isClass()
boolean isInterface()
isInterface in interface JavaTypeboolean isEnum()
boolean isAnnotation()
isAnnotation in interface JavaTypeSourcePackage getSourcePackage()
java.lang.String getPackageName()
getPackageName in interface JavaTypeboolean isExported()
isExported in interface JavaType@Deprecated boolean isAnonymous()
SourceSuperclassClause getSuperclassClause()
getSourceSuperclass() and setSourceSuperclass(SourceTypeReference).SourceInterfacesClause getInterfacesClause()
getSourceInterfaces().SourceClassBody getSourceBody()
java.util.List<SourceTypeParameter> getSourceTypeParameters()
SourceTypeReference getSourceSuperclass()
void setSourceSuperclass(SourceTypeReference superclass)
java.lang.UnsupportedOperationException - if this class may not have a superclass.java.lang.IllegalStateException - if the input element is already linked.java.util.List<SourceTypeReference> getSourceInterfaces()
java.util.List<SourceMember> getSourceMembers()
java.util.Collection<SourceMemberVariable> getSourceMemberVariables()
SourceMemberVariable getSourceMemberVariable(java.lang.String name)
name - Require non-null.java.util.List<SourceEnumConstant> getSourceEnumConstants()
java.util.List<SourceFieldDeclaration> getSourceFieldDeclarations()
java.util.Collection<SourceFieldVariable> getSourceFieldVariables()
SourceFieldVariable getSourceFieldVariable(java.lang.String name)
name - Require non-null.java.util.List<SourceMethod> getSourceMethods()
java.util.Collection<SourceMethod> getSourceMethods(java.lang.String name)
name - Require non-null.SourceMethod getSourceMethod(java.lang.String name, JavaType[] targetTypes)
name - Require non-null.targetTypes - Null indicates an empty parameter list.java.util.List<SourceMethod> getSourceConstructors()
SourceMethod getSourceConstructor(JavaType[] targetTypes)
targetTypes - Null indicates an empty parameter list.java.util.List<SourceClass> getSourceClasses()
java.util.List<SourceClass> getSourceAnonymousClasses()
java.util.List<SourceClass> getSourceLocalClasses()
SourceClass getSourceClass(java.lang.String name)
name - Require non-null.java.util.List<SourceClassInitializer> getSourceInitializers()
SourceMember getOwningMember()
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.