|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpolyglot.ext.jl.types.TypeObject_c
polyglot.ext.jl.types.Type_c
polyglot.ext.jl.types.ReferenceType_c
polyglot.ext.jl.types.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 inherited from class 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()
Return true if the class is an inner class. |
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()
Cast the type to a class type, or null. |
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.TypeObject |
equalsImpl, position, typeSystem |
| Methods inherited from interface polyglot.util.Copy |
copy |
| 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 ClassTypepublic abstract ClassType outer()
outer in interface ClassTypepublic abstract java.lang.String name()
name in interface Namedpublic ReferenceType container()
container in interface MemberInstancepublic java.lang.String fullName()
fullName in interface Namedpublic boolean isTopLevel()
ClassType
isTopLevel in interface ClassTypepublic boolean isMember()
ClassType
isMember in interface ClassTypepublic boolean isLocal()
ClassType
isLocal in interface ClassTypepublic boolean isAnonymous()
ClassType
isAnonymous in interface ClassTypepublic final boolean isInner()
ClassType
isInner in interface ClassTypepublic boolean isNested()
ClassType
isNested in interface ClassTypepublic boolean isInnerClass()
ClassType
isInnerClass in interface ClassTypepublic boolean isCanonical()
TypeObject
isCanonical in interface TypeObjectisCanonical in class Type_cpublic boolean isClass()
Type
isClass in interface TypeisClass in class Type_cpublic ClassType toClass()
Type
toClass in interface TypetoClass in class Type_cpublic abstract Package package_()
package_ in interface Importablepublic abstract Flags flags()
flags in interface MemberInstancepublic abstract java.util.List constructors()
constructors in interface ClassTypeConstructorInstancepublic abstract java.util.List memberClasses()
memberClasses in interface ClassTypeClassTypepublic abstract java.util.List methods()
methods in interface ReferenceTypemethods in class ReferenceType_cpublic abstract java.util.List fields()
fields in interface ReferenceTypefields in class ReferenceType_cpublic abstract java.util.List interfaces()
interfaces in interface ReferenceTypeinterfaces in class ReferenceType_cpublic abstract Type superType()
superType in interface ReferenceTypesuperType in class ReferenceType_cpublic FieldInstance fieldNamed(java.lang.String name)
fieldNamed in interface ClassTypepublic ClassType memberClassNamed(java.lang.String name)
memberClassNamed in interface ClassTypepublic boolean descendsFromImpl(Type ancestor)
Typeancestor.
descendsFromImpl in interface TypedescendsFromImpl in class ReferenceType_cpublic boolean isThrowable()
Type
isThrowable in interface TypeisThrowable in class Type_cpublic boolean isUncheckedException()
Type
isUncheckedException in interface TypeisUncheckedException in class Type_cpublic boolean isImplicitCastValidImpl(Type toType)
TypetoType.
isImplicitCastValidImpl in interface TypeisImplicitCastValidImpl in class ReferenceType_cpublic boolean isCastValidImpl(Type toType)
isCastValidImpl in interface TypeisCastValidImpl in class ReferenceType_cpublic final boolean isEnclosed(ClassType maybe_outer)
ClassTypeouter.
isEnclosed in interface ClassTypepublic final boolean hasEnclosingInstance(ClassType encl)
ClassTypeencl.
hasEnclosingInstance in interface ClassTypepublic java.lang.String translate(Resolver c)
Type
translate in interface Typetranslate in class Type_cc - 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
toString in interface TypetoString in class Type_cpublic boolean isEnclosedImpl(ClassType maybe_outer)
ClassTypeisEnclosed.
This method should only be called by the TypeSystem
or by a subclass.
isEnclosedImpl in interface ClassTypepublic 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 | |||||||||