|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object polyglot.ext.jl.types.TypeObject_c polyglot.ext.jl.types.Type_c polyglot.ext.jl.types.ReferenceType_c polyglot.ext.jl.types.ClassType_c
public abstract class ClassType_c
A ClassType
represents a class -- either loaded from a
classpath, parsed from a source file, or obtained from other source.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface polyglot.types.ClassType |
---|
ClassType.Kind |
Field Summary |
---|
Fields inherited from class polyglot.ext.jl.types.TypeObject_c |
---|
position, ts |
Fields inherited from interface polyglot.types.ClassType |
---|
ANONYMOUS, LOCAL, MEMBER, TOP_LEVEL |
Constructor Summary | |
---|---|
protected |
ClassType_c()
Used for deserializing types. |
|
ClassType_c(TypeSystem ts)
|
|
ClassType_c(TypeSystem ts,
Position pos)
|
Method Summary | |
---|---|
abstract java.util.List |
constructors()
Get the class's constructors. |
ReferenceType |
container()
Get the container class if a member class. |
boolean |
descendsFromImpl(Type ancestor)
Return true if this type descends from ancestor . |
FieldInstance |
fieldNamed(java.lang.String name)
Get a field of the class by name. |
abstract java.util.List |
fields()
Get the class's fields. |
abstract Flags |
flags()
Get the class's flags. |
java.lang.String |
fullName()
Get the full name of the class, if possible. |
boolean |
hasEnclosingInstance(ClassType encl)
Return true if an object of the class has an enclosing instance of encl . |
boolean |
hasEnclosingInstanceImpl(ClassType encl)
Return true if an object of the class has an enclosing instance of encl . |
abstract java.util.List |
interfaces()
Get the class's interfaces. |
boolean |
isAnonymous()
Return true if the class is an anonymous class. |
boolean |
isCanonical()
Return true if the type object contains no unknown/ambiguous types. |
boolean |
isCastValidImpl(Type toType)
Requires: all type arguments are canonical. |
boolean |
isClass()
Return true if a class type. |
boolean |
isEnclosed(ClassType maybe_outer)
Return true if the class is strictly contained in outer . |
boolean |
isEnclosedImpl(ClassType maybe_outer)
Implementation of isEnclosed . |
boolean |
isImplicitCastValidImpl(Type toType)
Return true if a value of this type can be assigned to a variable of type toType . |
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 |
isThrowable()
Return true if a subclass of Throwable. |
boolean |
isTopLevel()
Return true if the class is top-level (i.e., not inner). |
boolean |
isUncheckedException()
Return true if an unchecked exception. |
abstract ClassType.Kind |
kind()
Get the class's kind. |
abstract java.util.List |
memberClasses()
Get the class's member classes. |
ClassType |
memberClassNamed(java.lang.String name)
Get a member class of the class by name. |
abstract java.util.List |
methods()
Get the class's methods. |
abstract java.lang.String |
name()
Get the short name of the class, if possible. |
abstract ClassType |
outer()
Get the class's outer class, or null if a top-level class. |
abstract Package |
package_()
Get the class's package. |
abstract Type |
superType()
Get the class's super type. |
ClassType |
toClass()
Returns a non-null iff isClass() returns true. |
java.lang.String |
toString()
Yields a string representing this type. |
java.lang.String |
translate(Resolver c)
Return a string into which to translate the type. |
Methods inherited from class polyglot.ext.jl.types.ReferenceType_c |
---|
hasMethod, hasMethodImpl, isReference, methods, methodsNamed, toReference |
Methods inherited from class polyglot.ext.jl.types.Type_c |
---|
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPackage, isPrimitive, isShort, isSubtype, isSubtypeImpl, isType, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toNull, toPackage, toPrimitive, toType |
Methods inherited from class polyglot.ext.jl.types.TypeObject_c |
---|
copy, equals, equalsImpl, hashCode, position, typeSystem |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface polyglot.types.ClassType |
---|
inStaticContext |
Methods inherited from interface polyglot.types.ReferenceType |
---|
hasMethod, hasMethodImpl, methods, methodsNamed |
Methods inherited from interface polyglot.types.Type |
---|
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPrimitive, isReference, isShort, isSubtype, isSubtypeImpl, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toNull, toPrimitive, toReference |
Methods inherited from interface polyglot.types.Qualifier |
---|
isPackage, isType, toPackage, toType |
Constructor Detail |
---|
protected ClassType_c()
public ClassType_c(TypeSystem ts)
public ClassType_c(TypeSystem ts, Position pos)
Method Detail |
---|
public abstract ClassType.Kind kind()
kind
in interface ClassType
public abstract ClassType outer()
outer
in interface ClassType
public abstract java.lang.String name()
name
in interface Named
public ReferenceType container()
container
in interface MemberInstance
public java.lang.String fullName()
fullName
in interface Named
public boolean isTopLevel()
ClassType
isTopLevel
in interface ClassType
public boolean isMember()
ClassType
isMember
in interface ClassType
public boolean isLocal()
ClassType
isLocal
in interface ClassType
public boolean isAnonymous()
ClassType
isAnonymous
in interface ClassType
public final boolean isInner()
ClassType
isInner
in interface ClassType
public boolean isNested()
ClassType
isNested
in interface ClassType
public boolean isInnerClass()
ClassType
isInnerClass
in interface ClassType
public boolean isCanonical()
TypeObject
isCanonical
in interface TypeObject
isCanonical
in class Type_c
public boolean isClass()
Type
isClass
in interface Type
isClass
in class Type_c
public ClassType toClass()
Type_c
toClass
in interface Type
toClass
in class Type_c
public abstract Package package_()
package_
in interface Importable
public abstract Flags flags()
flags
in interface MemberInstance
public abstract java.util.List constructors()
constructors
in interface ClassType
ConstructorInstance
public abstract java.util.List memberClasses()
memberClasses
in interface ClassType
ClassType
public abstract java.util.List methods()
methods
in interface ReferenceType
methods
in class ReferenceType_c
MethodInstance
.MethodInstance
public abstract java.util.List fields()
fields
in interface ReferenceType
fields
in class ReferenceType_c
FieldInstance
.FieldInstance
public abstract java.util.List interfaces()
interfaces
in interface ReferenceType
interfaces
in class ReferenceType_c
Type
.Type
public abstract Type superType()
superType
in interface ReferenceType
superType
in class ReferenceType_c
public FieldInstance fieldNamed(java.lang.String name)
fieldNamed
in interface ClassType
fieldNamed
in interface ReferenceType
public ClassType memberClassNamed(java.lang.String name)
memberClassNamed
in interface ClassType
public boolean descendsFromImpl(Type ancestor)
Type_c
ancestor
.
descendsFromImpl
in interface Type
descendsFromImpl
in class ReferenceType_c
public boolean isThrowable()
Type_c
isThrowable
in interface Type
isThrowable
in class Type_c
public boolean isUncheckedException()
Type_c
isUncheckedException
in interface Type
isUncheckedException
in class Type_c
public boolean isImplicitCastValidImpl(Type toType)
Type_c
toType
.
isImplicitCastValidImpl
in interface Type
isImplicitCastValidImpl
in class ReferenceType_c
public boolean isCastValidImpl(Type toType)
isCastValidImpl
in interface Type
isCastValidImpl
in class ReferenceType_c
public final boolean isEnclosed(ClassType maybe_outer)
ClassType
outer
.
isEnclosed
in interface ClassType
public final boolean hasEnclosingInstance(ClassType encl)
ClassType
encl
.
hasEnclosingInstance
in interface ClassType
public java.lang.String translate(Resolver c)
Type_c
translate
in interface Type
translate
in class Type_c
c
- A resolver in which to lookup this type to determine if
the type is unique in the given resolver.public java.lang.String toString()
Type_c
toString
in interface Type
toString
in class Type_c
public boolean isEnclosedImpl(ClassType maybe_outer)
ClassType
isEnclosed
.
This method should only be called by the TypeSystem
or by a subclass.
isEnclosedImpl
in interface ClassType
public boolean hasEnclosingInstanceImpl(ClassType encl)
encl
.
hasEnclosingInstanceImpl
in interface ClassType
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |