public class JL5ParsedClassType_c extends ParsedClassType_c implements JL5ParsedClassType
ClassType.Kind
Modifier and Type | Field and Description |
---|---|
protected java.util.List<AnnotationTypeElemInstance> |
annotationElems |
protected Annotations |
annotations |
protected boolean |
annotationsResolved |
protected java.util.List<EnumInstance> |
enumConstants |
protected PClass<TypeVariable,ReferenceType> |
pclass |
protected java.util.List<TypeVariable> |
typeVars |
constructors, fields, flags, fromSource, init, inStaticContext, interfaces, job, kind, memberClasses, membersAdded, methods, name, needSerialization, outer, package_, signaturesResolved, superType, supertypesResolved
decl, memberCache
position, ts
Constructor and Description |
---|
JL5ParsedClassType_c(TypeSystem ts,
LazyClassInitializer init,
Source fromSource) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotationElem(AnnotationTypeElemInstance ai)
Add an AnnotationElemInstance.
|
void |
addEnumConstant(EnumInstance ei) |
AnnotationTypeElemInstance |
annotationElemNamed(java.lang.String name) |
java.util.List<AnnotationTypeElemInstance> |
annotationElems() |
Annotations |
annotations()
Annotations on the declaration of this type.
|
boolean |
annotationsResolved()
Have the annotations for this class (and for declarations within this class) been resolved?
|
boolean |
descendsFromImpl(Type ancestor)
Return true if this type descends from
ancestor . |
EnumInstance |
enumConstantNamed(java.lang.String name) |
java.util.List<EnumInstance> |
enumConstants() |
boolean |
enumValueOfMethodNeeded() |
boolean |
enumValuesMethodNeeded() |
JL5Subst |
erasureSubst()
Returns a subst suitable for the erased type: the subst
maps any type variables to their erasure.
|
boolean |
isCastValidImpl(Type toType)
Requires: all type arguments are canonical.
|
boolean |
isEnclosedImpl(ClassType maybe_outer)
Implementation of
isEnclosed . |
java.util.LinkedList<Type> |
isImplicitCastValidChainImpl(Type toType)
Return a chain of types that show that this class can be implicitly cast
to toType.
|
boolean |
isImplicitCastValidImpl(Type toType)
Return true if a value of this type can be assigned to a variable of
type
toType . |
boolean |
isRawClass()
Is this class a Raw Class? See JLS 3rd ed., 4.8
|
java.util.List<? extends JL5MethodInstance> |
methods(JL5MethodInstance mi) |
java.util.List<JL5MethodInstance> |
methodsNamed(java.lang.String name)
Return a list of all methods with the given name.
|
PClass<TypeVariable,ReferenceType> |
pclass()
Get the pclass for this class.
|
void |
print(CodeWriter w)
Pretty-print the name of this class to w.
|
void |
printNoParams(CodeWriter w) |
void |
setAnnotations(Annotations annotations) |
void |
setAnnotationsResolved(boolean annotationsResolved) |
void |
setPClass(PClass<TypeVariable,ReferenceType> pc) |
void |
setTypeVariables(java.util.List<TypeVariable> typeVars) |
java.util.Set<Type> |
superclasses()
All direct superclasses of the class.
|
java.lang.String |
toString()
Yields a string representing this type.
|
java.lang.String |
toStringNoParams() |
java.lang.String |
translate(Resolver c)
Return a string into which to translate the type.
|
java.lang.String |
translateAsReceiver(Resolver c)
Translate the type as it should be if it were the receiver
of a field or method call.
|
java.util.List<TypeVariable> |
typeVariables() |
addConstructor, addField, addInterface, addMemberClass, addMethod, constructors, defaultConstructorNeeded, fieldNamed, fields, flags, flags, fromSource, init, initializer, inStaticContext, inStaticContext, interfaces, job, kind, kind, memberClasses, membersAdded, methods, name, name, needSerialization, needSerialization, numSignaturesUnresolved, outer, outer, package_, package_, position, setConstructors, setContainer, setFields, setFlags, setInit, setInitializer, setInterfaces, setJob, setMemberClasses, setMembersAdded, setMethods, setSignaturesResolved, setSupertypesResolved, signaturesResolved, superType, superType, supertypesResolved
container, copy, declaration, fullName, hasEnclosingInstance, hasEnclosingInstanceImpl, isAnonymous, isCanonical, isClass, isEnclosed, isInner, isInnerClass, isLocal, isMember, isNested, isThrowable, isTopLevel, isUncheckedException, memberClassNamed, members, resolver, setDeclaration, toClass
hasMethod, hasMethodImpl, isReference, methods, toReference
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, typeEquals, typeEqualsImpl
equals, equalsImpl, hashCode, position, typeSystem
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addConstructor, addField, addInterface, addMemberClass, addMethod, defaultConstructorNeeded, flags, fromSource, inStaticContext, kind, membersAdded, name, needSerialization, needSerialization, numSignaturesUnresolved, outer, package_, position, setConstructors, setFields, setInterfaces, setJob, setMemberClasses, setMembersAdded, setMethods, setSignaturesResolved, setSupertypesResolved, signaturesResolved, superType, supertypesResolved
initializer, job, setInitializer
constructors, fieldNamed, hasEnclosingInstance, hasEnclosingInstanceImpl, inStaticContext, isAnonymous, isEnclosed, isInner, isInnerClass, isLocal, isMember, isNested, isTopLevel, kind, memberClasses, memberClassNamed, outer, resolver
package_
fields, hasMethod, hasMethodImpl, interfaces, members, methods, methods, superType
arrayOf, arrayOf, descendsFrom, isArray, isBoolean, isByte, isCastValid, isChar, isClass, isComparable, isDouble, isFloat, isImplicitCastValid, isInt, isIntOrLess, isLong, isLongOrLess, isNull, isNumeric, isPrimitive, isReference, isShort, isSubtype, isSubtypeImpl, isThrowable, isUncheckedException, isVoid, numericConversionValid, numericConversionValid, numericConversionValidImpl, numericConversionValidImpl, toArray, toClass, toNull, toPrimitive, toReference, typeEquals, typeEqualsImpl
container, flags, setContainer, setFlags
declaration, setDeclaration
protected PClass<TypeVariable,ReferenceType> pclass
protected java.util.List<TypeVariable> typeVars
protected java.util.List<EnumInstance> enumConstants
protected java.util.List<AnnotationTypeElemInstance> annotationElems
protected boolean annotationsResolved
protected Annotations annotations
public JL5ParsedClassType_c(TypeSystem ts, LazyClassInitializer init, Source fromSource)
public void addEnumConstant(EnumInstance ei)
addEnumConstant
in interface JL5ParsedClassType
public java.util.List<EnumInstance> enumConstants()
enumConstants
in interface JL5ClassType
enumConstants
in interface JL5ParsedClassType
public EnumInstance enumConstantNamed(java.lang.String name)
enumConstantNamed
in interface JL5ClassType
enumConstantNamed
in interface JL5ParsedClassType
public AnnotationTypeElemInstance annotationElemNamed(java.lang.String name)
annotationElemNamed
in interface JL5ClassType
public void addAnnotationElem(AnnotationTypeElemInstance ai)
JL5ParsedClassType
addAnnotationElem
in interface JL5ParsedClassType
public java.util.List<AnnotationTypeElemInstance> annotationElems()
annotationElems
in interface JL5ClassType
public java.util.List<? extends JL5MethodInstance> methods(JL5MethodInstance mi)
methods
in interface JL5ParsedClassType
public java.util.List<JL5MethodInstance> methodsNamed(java.lang.String name)
ParsedClassType_c
methodsNamed
in interface ReferenceType
methodsNamed
in class ParsedClassType_c
name
- Name of the method to search for.MethodInstance
.MethodInstance
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
isEnclosedImpl
in class ClassType_c
public boolean isCastValidImpl(Type toType)
ReferenceType_c
isCastValidImpl
in interface Type
isCastValidImpl
in class ClassType_c
public boolean isImplicitCastValidImpl(Type toType)
Type
toType
.isImplicitCastValidImpl
in interface Type
isImplicitCastValidImpl
in class ClassType_c
public java.util.LinkedList<Type> isImplicitCastValidChainImpl(Type toType)
JL5ClassType
isImplicitCastValidChainImpl
in interface JL5ClassType
public PClass<TypeVariable,ReferenceType> pclass()
JL5ParsedClassType
pclass
in interface JL5ParsedClassType
public void setPClass(PClass<TypeVariable,ReferenceType> pc)
setPClass
in interface JL5ParsedClassType
public void setTypeVariables(java.util.List<TypeVariable> typeVars)
setTypeVariables
in interface JL5ParsedClassType
public java.util.List<TypeVariable> typeVariables()
typeVariables
in interface JL5ParsedClassType
public JL5Subst erasureSubst()
JL5ParsedClassType
erasureSubst
in interface JL5ParsedClassType
public void print(CodeWriter w)
print
in interface Type
print
in class ClassType_c
public void printNoParams(CodeWriter w)
printNoParams
in interface JL5ParsedClassType
public java.lang.String toStringNoParams()
toStringNoParams
in interface JL5ParsedClassType
public java.lang.String toString()
Type
toString
in interface Type
toString
in class ParsedClassType_c
public boolean isRawClass()
JL5ClassType
isRawClass
in interface JL5ClassType
public java.lang.String translateAsReceiver(Resolver c)
JL5ClassType
translateAsReceiver
in interface JL5ClassType
public java.lang.String translate(Resolver c)
Type
translate
in interface Type
translate
in class ClassType_c
c
- A resolver in which to lookup this type to determine if
the type is unique in the given resolver.public boolean descendsFromImpl(Type ancestor)
Type
ancestor
.descendsFromImpl
in interface Type
descendsFromImpl
in class ClassType_c
public Annotations annotations()
JL5ClassType
annotations
in interface JL5ClassType
public void setAnnotations(Annotations annotations)
setAnnotations
in interface JL5ParsedClassType
public boolean enumValueOfMethodNeeded()
enumValueOfMethodNeeded
in interface JL5ParsedClassType
public boolean enumValuesMethodNeeded()
enumValuesMethodNeeded
in interface JL5ParsedClassType
public boolean annotationsResolved()
JL5ParsedClassType
annotationsResolved
in interface JL5ParsedClassType
public void setAnnotationsResolved(boolean annotationsResolved)
setAnnotationsResolved
in interface JL5ParsedClassType
public java.util.Set<Type> superclasses()
JL5ClassType
superclasses
in interface JL5ClassType