public interface JL5TypeSystem extends ParamTypeSystem<TypeVariable,ReferenceType>
SERIALIZE_MEMBERS_WITH_CONTAINER
Modifier and Type | Method and Description |
---|---|
boolean |
accessibleFromPackage(Flags flags,
Package pkg1,
Package pkg2) |
java.util.List<ReferenceType> |
allAncestorsOf(ReferenceType rt) |
ClassType |
Annotation() |
ClassType |
AnnotationElementType() |
AnnotationElementValue |
AnnotationElementValueAnnotation(Position pos,
Type type,
java.util.Map<java.lang.String,AnnotationElementValue> annotationElementValues) |
AnnotationElementValue |
AnnotationElementValueArray(Position pos,
java.util.List<AnnotationElementValue> vals) |
AnnotationElementValue |
AnnotationElementValueConstant(Position pos,
Type type,
java.lang.Object constVal) |
AnnotationTypeElemInstance |
annotationElemInstance(Position pos,
ClassType ct,
Flags f,
Type type,
java.lang.String name,
boolean hasDefault) |
Type |
applyCaptureConversion(Type t,
Position pos)
Apply capture conversion to t.
|
boolean |
areOverrideEquivalent(JL5MethodInstance mi,
JL5MethodInstance mj)
Are methods mi and mj override equivalent?
See JLS 3rd ed.
|
boolean |
areReturnTypeSubstitutable(Type ri,
Type rj)
Are types ri and rj return type substitutable?
See JLS 3rd ed.
|
ArrayType |
arrayOf(Position position,
Type base,
boolean isVarargs) |
Type |
boxingConversion(Type t)
Perform boxing conversion on t.
|
JL5ProcedureInstance |
callValid(JL5ProcedureInstance mi,
java.util.List<? extends Type> argTypes,
java.util.List<? extends ReferenceType> actualTypeArgs)
Check whether
ci can be called with
arguments of type actualTypes , with type parameters
instantiated with actualTypeArgs. |
boolean |
canBeRaw(Type type) |
void |
checkAnnotationValueConstant(Term value) |
void |
checkDuplicateAnnotations(java.util.List<AnnotationElem> annotations) |
boolean |
checkIntersectionBounds(java.util.List<? extends Type> bounds,
boolean quiet) |
void |
checkMethodNameClash(JL5MethodInstance mi,
ClassType ct)
Check whether mi's name clashes with some other method accessible in
type, according to JLS 3rd ed.
|
Type |
Class(Position pos,
ReferenceType type)
Return the class representing Class
type . |
java.util.List<TypeVariable> |
classAndEnclosingTypeVariables(JL5ParsedClassType ct)
What are the type variables of class ct or any outer
class for which an instance of ct has an enclosing instance?
|
JL5ConstructorInstance |
constructorInstance(Position pos,
ClassType container,
Flags flags,
java.util.List<? extends Type> argTypes,
java.util.List<? extends Type> excTypes,
java.util.List<TypeVariable> typeParams) |
Annotations |
createAnnotations(java.util.Map<Type,java.util.Map<java.lang.String,AnnotationElementValue>> annotationElems,
Position position) |
ParsedClassType |
createClassType(LazyClassInitializer init,
Source fromSource)
Create a new empty class.
|
ParsedClassType |
createClassType(Source fromSource)
Create a new empty class.
|
ClassType |
Enum() |
EnumInstance |
enumInstance(Position pos,
ClassType container,
Flags f,
java.lang.String name,
long ordinal) |
boolean |
equals(TypeObject arg1,
TypeObject arg2)
Returns true iff type1 and type2 represent the same type object.
|
JL5Subst |
erasureSubst(JL5ParsedClassType base)
Given a , produce a JL5RawSubst that maps the
TypeVariables to the erasure of their bounds.
|
JL5Subst |
erasureSubst(JL5ProcedureInstance pi)
Given a JL5ProcedureInstance, produce a JL5Subst that maps the
TypeVariables to the erasure of their bounds.
|
Type |
erasureType(Type t)
Returns the erased type of t.
|
AnnotationTypeElemInstance |
findAnnotation(ReferenceType t,
java.lang.String name,
ClassType currentClass) |
ConstructorInstance |
findConstructor(ClassType container,
java.util.List<? extends Type> argTypes,
java.util.List<? extends ReferenceType> typeArgs,
ClassType currClass,
boolean fromClient) |
EnumInstance |
findEnumConstant(ReferenceType container,
long ordinal) |
EnumInstance |
findEnumConstant(ReferenceType container,
java.lang.String name) |
EnumInstance |
findEnumConstant(ReferenceType container,
java.lang.String name,
ClassType currClass) |
EnumInstance |
findEnumConstant(ReferenceType container,
java.lang.String name,
Context c) |
FieldInstance |
findFieldOrEnum(ReferenceType container,
java.lang.String name,
ClassType currClass) |
JL5SubstClassType |
findGenericSupertype(JL5ParsedClassType base,
ReferenceType sub)
Base is a generic supertype (e.g., a class C with uninstantiated parameters).
|
MethodInstance |
findMethod(ReferenceType container,
java.lang.String name,
java.util.List<? extends Type> argTypes,
java.util.List<? extends ReferenceType> typeArgs,
ClassType currClass,
Type expectedReturnType,
boolean fromClient) |
Flags |
flagsForBits(int bits)
Given the JVM encoding of a set of flags, returns the Flags object
for that encoding.
|
ReferenceType |
glb(Position pos,
java.util.List<ReferenceType> bounds) |
ReferenceType |
glb(ReferenceType t1,
ReferenceType t2) |
boolean |
hasSameSignature(JL5MethodInstance mi,
JL5MethodInstance mj)
Do methods mi and mj have the same signature?
See JLS 3rd ed.
|
ClassType |
instantiate(Position pos,
JL5ParsedClassType clazz,
java.util.List<? extends ReferenceType> actuals)
Instantiate class clazz with actuals.
|
ClassType |
instantiate(Position pos,
JL5ParsedClassType clazz,
ReferenceType... actuals)
Instantiate class clazz with actuals.
|
JL5ProcedureInstance |
instantiate(Position pos,
JL5ProcedureInstance mi,
java.util.List<? extends ReferenceType> actuals) |
ClassType |
instantiateInnerClassFromContext(Context c,
ClassType ct) |
ReferenceType |
intersectionType(Position pos,
java.util.List<ReferenceType> types) |
boolean |
isBaseCastValid(Type from,
Type to) |
boolean |
isContained(Type fromType,
Type toType)
Is fromType contained in toType? See JLS 3rd ed 4.5.1.1
|
java.util.LinkedList<Type> |
isImplicitCastValidChain(Type t1,
Type t2) |
boolean |
isPrimitiveWrapper(Type l) |
boolean |
isReifiable(Type t)
Is the type reifiable (i.e., representable at runtime).
|
boolean |
isRetainedAnnotation(Type annotationType)
Given an annotation of type annotationType, should the annotation
be retained in the binary? See JLS 3rd ed, 9.6.1.2
|
boolean |
isSubSignature(JL5MethodInstance m1,
JL5MethodInstance m2)
Return true of the signature of m1 is a subsignature of the signature of
m2, according to JLS 3rd ed.
|
boolean |
isUncheckedConversion(Type from,
Type to)
Is there an unchecked conversion from "from" to "to"?
See JLS 3rd ed.
|
boolean |
isValidAnnotationValueType(Type t) |
ClassType |
Iterable() |
ClassType |
Iterator() |
LubType |
lub(Position pos,
java.util.List<ReferenceType> bounds)
Compute the least upper bound of a set of types
bounds . |
JL5MethodInstance |
methodCallValid(JL5MethodInstance mi,
java.lang.String name,
java.util.List<? extends Type> argTypes,
java.util.List<? extends ReferenceType> actualTypeArgs,
Type expectedReturnType)
Check whether
mi can be called with name name
and arguments of type actualTypes , with type parameters
instantiated with actualTypeArgs. |
JL5MethodInstance |
methodInstance(Position pos,
ReferenceType container,
Flags flags,
Type returnType,
java.lang.String name,
java.util.List<? extends Type> argTypes,
java.util.List<? extends Type> excTypes,
java.util.List<TypeVariable> typeParams) |
Annotations |
NoAnnotations()
A special Annotations that has no annotations.
|
boolean |
numericConversionBaseValid(Type t,
java.lang.Object value) |
ClassType |
OverrideAnnotation() |
PrimitiveType |
primitiveTypeOfWrapper(Type l) |
RawClass |
rawClass(JL5ParsedClassType base)
Create a raw class
|
RawClass |
rawClass(JL5ParsedClassType base,
Position pos)
Create a raw class
|
ClassType |
RetentionAnnotation() |
ClassType |
TargetAnnotation() |
Type |
toRawType(Type t)
Create a raw class
|
TypeVariable |
typeVariable(Position pos,
java.lang.String name,
ReferenceType upperBound) |
Type |
unboxingConversion(Type t)
Perform unboxing conversion on t.
|
UnknownReferenceType |
unknownReferenceType(Position position) |
UnknownTypeVariable |
unknownTypeVariable(Position position) |
WildCardType |
wildCardType(Position position) |
WildCardType |
wildCardType(Position position,
ReferenceType upperBound,
ReferenceType lowerBound) |
ClassType |
wrapperClassOfPrimitive(PrimitiveType t)
Returns the PrimitiveType corresponding to the wrapper type t.
|
instantiate, mutablePClass, subst, subst
Abstract, ArithmeticException, arrayOf, arrayOf, arrayOf, arrayOf, ArrayStoreException, Boolean, Byte, callValid, canCoerceToString, canOverride, Char, checkAccessFlags, checkClassConformance, checkConstructorFlags, checkCycles, checkFieldFlags, checkInitializerFlags, checkInterfaceFieldFlags, checkLocalClassFlags, checkLocalFlags, checkMemberClassFlags, checkMethodFlags, checkOverride, checkTopLevelClassFlags, Class, classAccessible, classAccessible, classAccessibleFromPackage, ClassCastException, classContextResolver, classContextResolver, classFileLazyClassInitializer, Cloneable, constructorInstance, createClassContextResolver, createClassType, createClassType, createContext, createNewFlag, createPackage, createPackage, createPackageContextResolver, defaultClassInitializer, defaultConstructor, defaultPackageImports, descendsFrom, deserializedClassInitializer, Double, Error, Exception, extensionInfo, fieldInstance, Final, findConstructor, findConstructor, findConstructor, findField, findField, findField, findField, findImplementingMethod, findMemberClass, findMemberClass, findMemberClass, findMethod, findMethod, findMethod, Float, forName, getTransformedClassName, getTypeEncoderRootSet, hasAccessibleMethodNamed, hasEnclosingInstance, hasFormals, hasMethod, hasMethodNamed, implemented, importTable, importTable, initialize, initializerInstance, Int, Interface, interfaces, isAccessible, isAccessible, isAccessible, isAccessible, isAccessible, isCanonical, isCastValid, isEnclosed, isImplicitCastValid, isInherited, isMember, isSameMethod, isSubtype, isThrowable, isUncheckedException, leastCommonAncestor, legalAbstractMethodFlags, legalAccessFlags, legalConstructorFlags, legalFieldFlags, legalInitializerFlags, legalInterfaceFieldFlags, legalLocalClassFlags, legalLocalFlags, legalMemberClassFlags, legalMethodFlags, legalTopLevelClassFlags, loadedResolver, localInstance, Long, methodCallValid, methodInstance, moreSpecific, Native, NoFlags, Null, NullPointerException, numericConversionValid, numericConversionValid, Object, OutOfBoundsException, overrides, packageContextResolver, packageContextResolver, packageContextResolver, packageEquals, packageExists, packageForName, packageForName, parsedResolver, placeHolder, placeHolder, primitiveForName, Private, promote, promote, Protected, Public, restoreSystemResolver, RuntimeException, saveSystemResolver, Serializable, Short, Static, staticTarget, StrictFP, String, superType, Synchronized, systemResolver, Throwable, throwsSubset, Transient, translateArray, translateClass, translatePackage, translatePrimitive, typeEquals, typeForName, uncheckedExceptions, unknownPackage, unknownQualifier, unknownType, Void, Volatile, wrapperTypeString
ParsedClassType createClassType(LazyClassInitializer init, Source fromSource)
TypeSystem
createClassType
in interface TypeSystem
ParsedClassType createClassType(Source fromSource)
TypeSystem
createClassType
in interface TypeSystem
ClassType Enum()
ClassType Iterable()
ClassType Iterator()
ClassType Annotation()
ClassType OverrideAnnotation()
ClassType TargetAnnotation()
ClassType RetentionAnnotation()
ClassType AnnotationElementType()
java.util.LinkedList<Type> isImplicitCastValidChain(Type t1, Type t2)
boolean hasSameSignature(JL5MethodInstance mi, JL5MethodInstance mj)
boolean isSubSignature(JL5MethodInstance m1, JL5MethodInstance m2)
m1
- m2
- boolean areOverrideEquivalent(JL5MethodInstance mi, JL5MethodInstance mj)
boolean areReturnTypeSubstitutable(Type ri, Type rj)
boolean isUncheckedConversion(Type from, Type to)
boolean isReifiable(Type t)
ClassType instantiate(Position pos, JL5ParsedClassType clazz, java.util.List<? extends ReferenceType> actuals) throws SemanticException
SemanticException
ClassType instantiate(Position pos, JL5ParsedClassType clazz, ReferenceType... actuals) throws SemanticException
SemanticException
JL5Subst erasureSubst(JL5ProcedureInstance pi)
JL5Subst erasureSubst(JL5ParsedClassType base)
JL5MethodInstance methodInstance(Position pos, ReferenceType container, Flags flags, Type returnType, java.lang.String name, java.util.List<? extends Type> argTypes, java.util.List<? extends Type> excTypes, java.util.List<TypeVariable> typeParams)
JL5ConstructorInstance constructorInstance(Position pos, ClassType container, Flags flags, java.util.List<? extends Type> argTypes, java.util.List<? extends Type> excTypes, java.util.List<TypeVariable> typeParams)
JL5ProcedureInstance instantiate(Position pos, JL5ProcedureInstance mi, java.util.List<? extends ReferenceType> actuals)
JL5MethodInstance methodCallValid(JL5MethodInstance mi, java.lang.String name, java.util.List<? extends Type> argTypes, java.util.List<? extends ReferenceType> actualTypeArgs, Type expectedReturnType)
mi
can be called with name name
and arguments of type actualTypes
, with type parameters
instantiated with actualTypeArgs. If actualTypeArgs is null or empty,
then type inference should be performed. (See JLS 3rd ed. 15.12.2.7)
Will return null if mi cannot be successfully called. Will return an appropriately
instantiated method instance if the call is valid (i.e., the substitution after type inference).JL5ProcedureInstance callValid(JL5ProcedureInstance mi, java.util.List<? extends Type> argTypes, java.util.List<? extends ReferenceType> actualTypeArgs)
ci
can be called with
arguments of type actualTypes
, with type parameters
instantiated with actualTypeArgs. If actualTypeArgs is null or empty,
then type inference should be performed. (See JLS 3rd ed. 15.12.2.7)
Will return null if ci cannot be successfully called. Will return an appropriately
instantiated instance if the call is valid (i.e., the substitution after type inference).ClassType wrapperClassOfPrimitive(PrimitiveType t)
PrimitiveType primitiveTypeOfWrapper(Type l)
boolean isPrimitiveWrapper(Type l)
EnumInstance enumInstance(Position pos, ClassType container, Flags f, java.lang.String name, long ordinal)
EnumInstance findEnumConstant(ReferenceType container, long ordinal) throws SemanticException
SemanticException
EnumInstance findEnumConstant(ReferenceType container, java.lang.String name, ClassType currClass) throws SemanticException
SemanticException
EnumInstance findEnumConstant(ReferenceType container, java.lang.String name, Context c) throws SemanticException
SemanticException
EnumInstance findEnumConstant(ReferenceType container, java.lang.String name) throws SemanticException
SemanticException
FieldInstance findFieldOrEnum(ReferenceType container, java.lang.String name, ClassType currClass) throws SemanticException
SemanticException
boolean numericConversionBaseValid(Type t, java.lang.Object value)
boolean isContained(Type fromType, Type toType)
Type applyCaptureConversion(Type t, Position pos) throws SemanticException
SemanticException
Flags flagsForBits(int bits)
TypeSystem
flagsForBits
in interface TypeSystem
TypeVariable typeVariable(Position pos, java.lang.String name, ReferenceType upperBound)
WildCardType wildCardType(Position position)
WildCardType wildCardType(Position position, ReferenceType upperBound, ReferenceType lowerBound)
boolean equals(TypeObject arg1, TypeObject arg2)
TypeSystem
equals
in interface TypeSystem
java.util.List<ReferenceType> allAncestorsOf(ReferenceType rt)
MethodInstance findMethod(ReferenceType container, java.lang.String name, java.util.List<? extends Type> argTypes, java.util.List<? extends ReferenceType> typeArgs, ClassType currClass, Type expectedReturnType, boolean fromClient) throws SemanticException
SemanticException
ConstructorInstance findConstructor(ClassType container, java.util.List<? extends Type> argTypes, java.util.List<? extends ReferenceType> typeArgs, ClassType currClass, boolean fromClient) throws SemanticException
SemanticException
JL5SubstClassType findGenericSupertype(JL5ParsedClassType base, ReferenceType sub)
ReferenceType intersectionType(Position pos, java.util.List<ReferenceType> types)
boolean checkIntersectionBounds(java.util.List<? extends Type> bounds, boolean quiet) throws SemanticException
SemanticException
ReferenceType glb(ReferenceType t1, ReferenceType t2)
ReferenceType glb(Position pos, java.util.List<ReferenceType> bounds)
UnknownReferenceType unknownReferenceType(Position position)
RawClass rawClass(JL5ParsedClassType base, Position pos)
RawClass rawClass(JL5ParsedClassType base)
boolean canBeRaw(Type type)
type
- Type boxingConversion(Type t)
Type unboxingConversion(Type t)
LubType lub(Position pos, java.util.List<ReferenceType> bounds)
bounds
. This is the
lub(U1 ... Uk) function, as defined in the JLS 3rd edition, Section 15.12.2.7.boolean isValidAnnotationValueType(Type t)
AnnotationTypeElemInstance annotationElemInstance(Position pos, ClassType ct, Flags f, Type type, java.lang.String name, boolean hasDefault)
void checkAnnotationValueConstant(Term value) throws SemanticException
SemanticException
AnnotationTypeElemInstance findAnnotation(ReferenceType t, java.lang.String name, ClassType currentClass) throws SemanticException
SemanticException
void checkDuplicateAnnotations(java.util.List<AnnotationElem> annotations) throws SemanticException
SemanticException
void checkMethodNameClash(JL5MethodInstance mi, ClassType ct) throws SemanticException
mi
- ct
- SemanticException
Type Class(Position pos, ReferenceType type)
type
.type
- java.util.List<TypeVariable> classAndEnclosingTypeVariables(JL5ParsedClassType ct)
ClassType instantiateInnerClassFromContext(Context c, ClassType ct)
UnknownTypeVariable unknownTypeVariable(Position position)
position
- Annotations createAnnotations(java.util.Map<Type,java.util.Map<java.lang.String,AnnotationElementValue>> annotationElems, Position position)
boolean isRetainedAnnotation(Type annotationType)
Annotations NoAnnotations()
AnnotationElementValue AnnotationElementValueArray(Position pos, java.util.List<AnnotationElementValue> vals)
AnnotationElementValue AnnotationElementValueAnnotation(Position pos, Type type, java.util.Map<java.lang.String,AnnotationElementValue> annotationElementValues)
AnnotationElementValue AnnotationElementValueConstant(Position pos, Type type, java.lang.Object constVal)