Class TypeVariableBinding
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeVariableBinding
- Direct Known Subclasses:
CaptureBinding
,InferenceVariable
Binding for a type parameter, held by source/binary type or method.
-
Field Summary
Modifier and TypeFieldDescriptionDenote the first explicit (binding) bound amongst the supertypes (from declaration in source) If no superclass was specified, then it denotes the first superinterface, or null if none was specified.char[]
int
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
compoundName, fPackage, LUB_GENERIC, modifiers, samProblemBinding, singleAbstractMethod, sourceName
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
BOOLEAN, BYTE, CHAR, DOUBLE, extendedTagBits, FLOAT, id, INT, LONG, NULL, SHORT, tagBits, TYPE_USE_BINDING, typeAnnotations, VOID
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
ANY_EXCEPTION, ARRAY_TYPE, BASE_TYPE, DefaultLocationArrayContents, DefaultLocationField, DefaultLocationParameter, DefaultLocationReturnType, DefaultLocationsForTrueValue, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, FIELD, GENERIC_TYPE, IMPORT, INTERSECTION_TYPE, INTERSECTION_TYPE18, LOCAL, METHOD, MODULE, NO_ANNOTATIONS, NO_COMPONENTS, NO_ELEMENT_VALUE_PAIRS, NO_EXCEPTIONS, NO_FIELDS, NO_MEMBER_TYPES, NO_METHODS, NO_MODULES, NO_NULL_DEFAULT, NO_PACKAGES, NO_PARAMETER_NAMES, NO_PARAMETERS, NO_PERMITTEDTYPES, NO_PLAIN_PACKAGES, NO_REFERENCE_TYPES, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, NULL_UNSPECIFIED_BY_DEFAULT, NullnessDefaultMASK, PACKAGE, PARAMETERIZED_TYPE, PATTERN, POLY_TYPE, RAW_TYPE, RECORD_COMPONENT, TYPE, TYPE_PARAMETER, TYPE_USE, UNINITIALIZED_COMPONENTS, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPE
-
Constructor Summary
ModifierConstructorDescriptionTypeVariableBinding(char[] sourceName, Binding declaringElement, int rank, LookupEnvironment environment)
protected
TypeVariableBinding(char[] sourceName, LookupEnvironment environment)
TypeVariableBinding(TypeVariableBinding prototype)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Used to implement this sentence from o.e.j.annotation.DefaultLocation: "Wildcards and the use of type variables are always excluded from NonNullByDefault."protected void
appendNullAnnotation(StringBuffer nameBuffer, CompilerOptions options)
boundCheck(Substitution substitution, TypeBinding argumentType, Scope scope, ASTNode location)
Returns true if the argument type satisfies all bounds of the type parameterint
boolean
Answer true if the receiver can be instantiatedclone(TypeBinding enclosingType)
Virtual copy constructor: a copy is made of the receiver's entire instance state and then suitably parameterized by the arguments to the clone operation as seen fit by each type.void
collectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint)
Collect the substitutes into a map for certain type variables inside the receiver type e.g.combineTypeAnnotations(TypeBinding substitute)
char[]
computeUniqueKey(boolean isLeaf)
p.X{} -> Lp/X; char[]
Answer the receiver's constant pool name.downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables)
Perform a downwards type projection as per JLS 4.10.5boolean
Call this before descending into type details to prevent infinite recursion.boolean
erasure()
void
evaluateNullAnnotations(Scope scope, TypeParameter parameter)
void
Exit the context of a potentially recursive function.void
char[]
T::Ljava/util/Map;:Ljava/io/Serializable; T:LYchar[]
T::Ljava/util/Map;:Ljava/io/Serializable; T:LYprotected TypeBinding[]
boolean
hasTypeBit(int bit)
Answer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable
.boolean
isErasureBoundTo(TypeBinding type)
Returns true if the type variable is directly bound to a given typeboolean
boolean
Returns true if the type hierarchy is connectedboolean
isInterchangeableWith(TypeVariableBinding otherVariable, Substitution substitute)
Returns true if the 2 variables are playing exact same role: they have the same bounds, providing one is substituted with the other:> is interchangeable with >. boolean
isProperType(boolean admitCapture18)
JLS8 Sect 18.1.1boolean
isSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527)
boolean
Returns true if the type was declared as a type variableint
kind()
boolean
mentionsAny(TypeBinding[] parameters, int idx)
Does this type mention any of the given type parameters, except the one at position 'idx'?char[]
nullAnnotatedReadableName(CompilerOptions options, boolean shortNames)
Answer a readable name (for error reporting) that includes nullness type annotations.char[]
Answer the receiver's signature.setFirstBound(TypeBinding firstBound)
setSuperClass(ReferenceBinding superclass)
setSuperInterfaces(ReferenceBinding[] superInterfaces)
void
setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations)
char[]
toString()
Return this type minus its type annotationslong
Refresh some tagBits from details into the main type.Upper bound doesn't perform erasureupwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables)
Perform an upwards type projection as per JLS 4.10.5Return this type minus its toplevel null annotations.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
applyCloseableClassWhitelists, applyCloseableInterfaceWhitelists, availableFields, availableMethods, binarySearch, binarySearch, canBeSeenBy, canBeSeenBy, canBeSeenBy, components, computeGenericTypeSignature, computeId, computeId, depth, detectAnnotationCycle, enclosingTypeAt, enumConstantCount, fieldCount, fields, getAccessFlags, getAnnotations, getAnnotationTagBits, getEnclosingInstancesSlotSize, getExactConstructor, getExactMethod, getField, getField, getFileName, getInterfaceAbstractContracts, getMemberType, getMethods, getMethods, getOuterLocalVariablesSlotSize, getPackage, getSingleAbstractMethod, getTypeVariable, hasEnclosingInstanceContext, hashCode, hasHierarchyCheckStarted, hasIncompatibleSuperType, hasMemberTypes, hasMethodWithNumArgs, hasNullBit, hasRestrictedAccess, implementsInterface, innerCanBeSeenBy, innerCanBeSeenBy, isAbstract, isAnnotationType, isBinaryBinding, isClass, isCompatibleWith, isConsistentIntersection, isDefault, isDeprecated, isEnum, isFinal, isFunctionalInterface, isHierarchyBeingActivelyConnected, isHierarchyBeingConnected, isInterface, isNestmateOf, isNonSealed, isOrEnclosedByPrivateType, isPrivate, isProtected, isPublic, isSealed, isStatic, isStrictfp, isSubTypeOfRTL, isSuperclassOf, isThrowable, isUncheckedException, isUsed, isViewedAsDeprecated, memberTypes, methods, module, outermostEnclosingType, permittedTypes, qualifiedSourceName, readableName, retrieveAnnotationHolder, setAnnotations, setContainerAnnotationType, setHierarchyCheckDone, shortReadableName, signature, sortFields, sortMethods, sourceName, syntheticEnclosingInstanceTypes, tagAsHavingDefectiveContainerType, unResolvedFields
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
actualType, capture, closestMatch, collectMissingTypes, containerAnnotationType, dimensions, enclosingMethod, enclosingType, equalsEquals, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, getErasureCompatibleType, getIntersectingTypes, getTypeAnnotations, hasNullTypeAnnotations, hasTypeAnnotations, hasValueBasedTypeAnnotation, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isBoxedPrimitiveType, isBoxingCompatibleWith, isCapture, isCompatibleWith, isEquivalentTo, isFunctionalType, isGenericType, isHierarchyInconsistent, isIntersectionType, isIntersectionType18, isLocalType, isMemberType, isNestedType, isNumericType, isParameterizedType, isParameterizedTypeWithActualArguments, isParameterizedWithOwnVariables, isPolyType, isPotentiallyCompatibleWith, isPrimitiveOrBoxedPrimitiveType, isPrimitiveType, isProvablyDistinct, isRawType, isRecord, isReifiable, isRepeatableAnnotationType, isTypeArgumentContainedBy, isUnboundWildcard, isUnresolvedType, isWildcard, leafComponentType, needsUncheckedConversion, notEquals, original, prototype, qualifiedPackageName, signableName, sIsMoreSpecific, swapUnresolved, syntheticOuterLocalVariables, typeVariables, uncapture, wellKnownBaseType, wellKnownType
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isParameter, isTaggedRepeatable, isValid, isValidBinding, isVolatile, problemId, setAnnotations
-
Field Details
-
declaringElement
-
rank
public int rank -
firstBound
Denote the first explicit (binding) bound amongst the supertypes (from declaration in source) If no superclass was specified, then it denotes the first superinterface, or null if none was specified. -
superclass
-
superInterfaces
-
genericTypeSignature
public char[] genericTypeSignature
-
-
Constructor Details
-
TypeVariableBinding
public TypeVariableBinding(char[] sourceName, Binding declaringElement, int rank, LookupEnvironment environment) -
TypeVariableBinding
-
TypeVariableBinding
-
-
Method Details
-
boundCheck
public TypeConstants.BoundCheckStatus boundCheck(Substitution substitution, TypeBinding argumentType, Scope scope, ASTNode location)Returns true if the argument type satisfies all bounds of the type parameter- Parameters:
location
- if non-null this may be used for reporting errors relating to null type annotations (if enabled)
-
boundsCount
public int boundsCount() -
canBeInstantiated
public boolean canBeInstantiated()Description copied from class:ReferenceBinding
Answer true if the receiver can be instantiated- Overrides:
canBeInstantiated
in classReferenceBinding
- See Also:
ReferenceBinding.canBeInstantiated()
-
collectSubstitutes
public void collectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint)Collect the substitutes into a map for certain type variables inside the receiver type e.g. Collection.collectSubstitutes(Collection - >, Map), will populate Map with: T --> List
Constraints: A << F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EXTENDS (1)) A = F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_EQUAL (0)) A >> F corresponds to: F.collectSubstitutes(..., A, ..., CONSTRAINT_SUPER (2)) - Overrides:
collectSubstitutes
in classTypeBinding
-
computeUniqueKey
public char[] computeUniqueKey(boolean isLeaf)Description copied from class:ReferenceBinding
p.X{} -> Lp/X; - Overrides:
computeUniqueKey
in classReferenceBinding
-
constantPoolName
public char[] constantPoolName()Description copied from class:ReferenceBinding
Answer the receiver's constant pool name. NOTE: This method should only be used during/after code gen.- Overrides:
constantPoolName
in classReferenceBinding
-
clone
Description copied from class:TypeBinding
Virtual copy constructor: a copy is made of the receiver's entire instance state and then suitably parameterized by the arguments to the clone operation as seen fit by each type. Parameters may not make sense for every type in the hierarchy, in which case they are silently ignored. A type may choose to retain a copy of the prototype for reference.- Overrides:
clone
in classTypeBinding
-
annotatedDebugName
- Overrides:
annotatedDebugName
in classTypeBinding
-
debugName
- Overrides:
debugName
in classReferenceBinding
- See Also:
TypeBinding.debugName()
-
erasure
- Overrides:
erasure
in classTypeBinding
-
genericSignature
public char[] genericSignature()T::Ljava/util/Map;:Ljava/io/Serializable; T:LY -
genericTypeSignature
public char[] genericTypeSignature()T::Ljava/util/Map;:Ljava/io/Serializable; T:LY- Overrides:
genericTypeSignature
in classTypeBinding
-
hasTypeBit
public boolean hasTypeBit(int bit)Description copied from class:TypeBinding
Answer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable
.- Overrides:
hasTypeBit
in classTypeBinding
-
isErasureBoundTo
Returns true if the type variable is directly bound to a given type -
isHierarchyConnected
public boolean isHierarchyConnected()Description copied from class:ReferenceBinding
Returns true if the type hierarchy is connected- Overrides:
isHierarchyConnected
in classReferenceBinding
-
isInterchangeableWith
Returns true if the 2 variables are playing exact same role: they have the same bounds, providing one is substituted with the other:> is interchangeable with >. -
isSubtypeOf
- Overrides:
isSubtypeOf
in classReferenceBinding
-
enterRecursiveFunction
public boolean enterRecursiveFunction()Description copied from class:TypeBinding
Call this before descending into type details to prevent infinite recursion.- Overrides:
enterRecursiveFunction
in classTypeBinding
- Returns:
- true if a recursion was not already started.
-
exitRecursiveFunction
public void exitRecursiveFunction()Description copied from class:TypeBinding
Exit the context of a potentially recursive function.- Overrides:
exitRecursiveFunction
in classTypeBinding
-
enterRecursiveProjectionFunction
public boolean enterRecursiveProjectionFunction() -
exitRecursiveProjectionFunction
public void exitRecursiveProjectionFunction() -
isProperType
public boolean isProperType(boolean admitCapture18)Description copied from class:TypeBinding
JLS8 Sect 18.1.1- Overrides:
isProperType
in classReferenceBinding
- Parameters:
admitCapture18
- request ifCaptureBinding18
shuld be considered as a proper type. If unsure say 'true', only inScope.greaterLowerBound(TypeBinding[], Scope, LookupEnvironment)
CaptureBinding18 has to be excluded to prevent an NPE on a branch that heuristically tries to avoid inconsistent intersections.
-
isTypeVariable
public boolean isTypeVariable()Returns true if the type was declared as a type variable- Overrides:
isTypeVariable
in classTypeBinding
-
kind
public int kind()- Overrides:
kind
in classTypeBinding
-
mentionsAny
Description copied from class:TypeBinding
Does this type mention any of the given type parameters, except the one at position 'idx'?- Overrides:
mentionsAny
in classTypeBinding
-
otherUpperBounds
-
readableName
public char[] readableName()Description copied from class:ReferenceBinding
Answer the receiver's signature. NOTE: This method should only be used during/after code gen.- Overrides:
readableName
in classReferenceBinding
- See Also:
ReferenceBinding.readableName()
-
setTypeAnnotations
- Overrides:
setTypeAnnotations
in classTypeBinding
-
shortReadableName
public char[] shortReadableName()- Overrides:
shortReadableName
in classReferenceBinding
- See Also:
ReferenceBinding.shortReadableName()
-
superclass
- Overrides:
superclass
in classReferenceBinding
-
superInterfaces
- Overrides:
superInterfaces
in classReferenceBinding
-
toString
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
nullAnnotatedReadableName
Description copied from class:TypeBinding
Answer a readable name (for error reporting) that includes nullness type annotations.- Overrides:
nullAnnotatedReadableName
in classReferenceBinding
- See Also:
TypeBinding.nullAnnotatedReadableName(CompilerOptions,boolean)
-
appendNullAnnotation
- Overrides:
appendNullAnnotation
in classReferenceBinding
-
unannotated
Description copied from class:TypeBinding
Return this type minus its type annotations- Overrides:
unannotated
in classTypeBinding
-
withoutToplevelNullAnnotation
Description copied from class:TypeBinding
Return this type minus its toplevel null annotations. Any annotations on type arguments or bounds are retained.- Overrides:
withoutToplevelNullAnnotation
in classTypeBinding
-
upperBound
Upper bound doesn't perform erasure -
allUpperBounds
-
evaluateNullAnnotations
-
setFirstBound
-
setSuperClass
-
setSuperInterfaces
-
getDerivedTypesForDeferredInitialization
-
combineTypeAnnotations
-
acceptsNonNullDefault
public boolean acceptsNonNullDefault()Description copied from class:TypeBinding
Used to implement this sentence from o.e.j.annotation.DefaultLocation: "Wildcards and the use of type variables are always excluded from NonNullByDefault."- Overrides:
acceptsNonNullDefault
in classReferenceBinding
-
updateTagBits
public long updateTagBits()Description copied from class:TypeBinding
Refresh some tagBits from details into the main type. Currently handled: TagBits.HasNullTypeAnnotation- Overrides:
updateTagBits
in classTypeBinding
-
isFreeTypeVariable
public boolean isFreeTypeVariable()- Overrides:
isFreeTypeVariable
in classTypeBinding
-
upwardsProjection
Description copied from class:ReferenceBinding
Perform an upwards type projection as per JLS 4.10.5- Overrides:
upwardsProjection
in classReferenceBinding
- Parameters:
scope
- Relevant scope for evaluating type projectionmentionedTypeVariables
- Filter for mentioned type variabled
-
downwardsProjection
Description copied from class:ReferenceBinding
Perform a downwards type projection as per JLS 4.10.5- Overrides:
downwardsProjection
in classReferenceBinding
- Parameters:
scope
- Relevant scope for evaluating type projectionmentionedTypeVariables
- Filter for mentioned type variabled
-