|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ClassType
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.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 |
---|
static final ClassType.Kind TOP_LEVEL
static final ClassType.Kind MEMBER
static final ClassType.Kind LOCAL
static final ClassType.Kind ANONYMOUS
Method Detail |
---|
ClassType.Kind kind()
boolean isTopLevel()
boolean isInner()
boolean isNested()
boolean isInnerClass()
boolean isMember()
boolean isLocal()
boolean isAnonymous()
boolean inStaticContext()
java.util.List constructors()
ConstructorInstance
.
ConstructorInstance
java.util.List memberClasses()
ClassType
.
ClassType
ClassType memberClassNamed(java.lang.String name)
FieldInstance fieldNamed(java.lang.String name)
fieldNamed
in interface ReferenceType
boolean isEnclosed(ClassType outer)
outer
.
boolean isEnclosedImpl(ClassType outer)
isEnclosed
.
This method should only be called by the TypeSystem
or by a subclass.
boolean hasEnclosingInstance(ClassType encl)
encl
.
boolean hasEnclosingInstanceImpl(ClassType encl)
hasEnclosingInstance
.
This method should only be called by the TypeSystem
or by a subclass.
ClassType outer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |