|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A ClassType
represents a class, either loaded from a
classpath, parsed from a source file, or obtained from other source.
A ClassType
is not necessarily named.
Nested Class Summary | |
static class |
ClassType.Kind
|
Field Summary | |
static ClassType.Kind |
ANONYMOUS
|
static ClassType.Kind |
LOCAL
|
static ClassType.Kind |
MEMBER
|
static ClassType.Kind |
TOP_LEVEL
|
Method Summary | |
java.util.List |
constructors()
The class's constructors. |
FieldInstance |
fieldNamed(java.lang.String name)
Get a field by name, or null. |
boolean |
hasEnclosingInstance(ClassType encl)
Return true if an object of the class has an enclosing instance of encl . |
boolean |
hasEnclosingInstanceImpl(ClassType encl)
Implementation of hasEnclosingInstance . |
boolean |
inStaticContext()
Return true if the class declaration occurs in a static context. |
boolean |
isAnonymous()
Return true if the class is an anonymous class. |
boolean |
isEnclosed(ClassType outer)
Return true if the class is strictly contained in outer . |
boolean |
isEnclosedImpl(ClassType outer)
Implementation of isEnclosed . |
boolean |
isInner()
Deprecated. Was incorrectly defined. Use isNested for nested classes, and isInnerClass for inner classes. |
boolean |
isInnerClass()
Return true if the class is an inner class, that is, it is a nested class that is not explicitly or implicitly declared static; an interface is never an inner class. |
boolean |
isLocal()
Return true if the class is a local class. |
boolean |
isMember()
Return true if the class is a member class. |
boolean |
isNested()
Return true if the class is a nested. |
boolean |
isTopLevel()
Return true if the class is top-level (i.e., not inner). |
ClassType.Kind |
kind()
Get the class's kind. |
java.util.List |
memberClasses()
The class's member classes. |
ClassType |
memberClassNamed(java.lang.String name)
Returns the member class with the given name, or null. |
ClassType |
outer()
The class's outer class if this is a nested class, or null. |
Methods inherited from interface polyglot.types.Importable |
package_ |
Methods inherited from interface polyglot.types.Named |
fullName, name |
Methods inherited from interface polyglot.types.TypeObject |
equalsImpl, isCanonical, position, typeSystem |
Methods inherited from interface polyglot.util.Copy |
copy |
Methods inherited from interface polyglot.types.ReferenceType |
fields, hasMethod, hasMethodImpl, interfaces, methods, methods, methodsNamed, superType |
Methods inherited from interface polyglot.types.Type |
arrayOf, arrayOf, descendsFrom, descendsFromImpl, isArray, isBoolean, isByte, isCastValid, isCastValidImpl, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isImplicitCastValidImpl, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPrimitive, isReference, isShort, isSubtype, isSubtypeImpl, isThrowable, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toClass, toNull, toPrimitive, toReference, toString, translate |
Methods inherited from interface polyglot.types.Qualifier |
isPackage, isType, toPackage, toType |
Methods inherited from interface polyglot.types.MemberInstance |
container, flags |
Field Detail |
public static final ClassType.Kind TOP_LEVEL
public static final ClassType.Kind MEMBER
public static final ClassType.Kind LOCAL
public static final ClassType.Kind ANONYMOUS
Method Detail |
public ClassType.Kind kind()
public boolean isTopLevel()
public boolean isInner()
public boolean isNested()
public boolean isInnerClass()
public boolean isMember()
public boolean isLocal()
public boolean isAnonymous()
public boolean inStaticContext()
public java.util.List constructors()
ConstructorInstance
.
ConstructorInstance
public java.util.List memberClasses()
ClassType
.
ClassType
public ClassType memberClassNamed(java.lang.String name)
public FieldInstance fieldNamed(java.lang.String name)
fieldNamed
in interface ReferenceType
public boolean isEnclosed(ClassType outer)
outer
.
public boolean isEnclosedImpl(ClassType outer)
isEnclosed
.
This method should only be called by the TypeSystem
or by a subclass.
public boolean hasEnclosingInstance(ClassType encl)
encl
.
public boolean hasEnclosingInstanceImpl(ClassType encl)
hasEnclosingInstance
.
This method should only be called by the TypeSystem
or by a subclass.
public ClassType outer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |