public class TypeVariableBinding extends ReferenceBinding
| Modifier and Type | Field and Description |
|---|---|
Binding |
declaringElement |
TypeBinding |
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.
|
char[] |
genericTypeSignature |
int |
rank |
ReferenceBinding |
superclass |
ReferenceBinding[] |
superInterfaces |
compoundName, fPackage, LUB_GENERIC, modifiers, samProblemBinding, singleAbstractMethod, sourceNameBOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, id, INT, LONG, NULL, SHORT, tagBits, TYPE_USE_BINDING, typeAnnotations, VOIDANY_EXCEPTION, ARRAY_TYPE, BASE_TYPE, DefaultLocationArrayContents, DefaultLocationField, DefaultLocationParameter, DefaultLocationReturnType, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, FIELD, GENERIC_TYPE, IMPORT, INTERSECTION_TYPE, INTERSECTION_TYPE18, LOCAL, METHOD, NO_ANNOTATIONS, NO_ELEMENT_VALUE_PAIRS, NO_EXCEPTIONS, NO_FIELDS, NO_MEMBER_TYPES, NO_METHODS, NO_NULL_DEFAULT, NO_PARAMETER_NAMES, NO_PARAMETERS, NO_REFERENCE_TYPES, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, NONNULL_BY_DEFAULT, NULL_UNSPECIFIED_BY_DEFAULT, NullnessDefaultMASK, PACKAGE, PARAMETERIZED_TYPE, POLY_TYPE, RAW_TYPE, TYPE, TYPE_PARAMETER, TYPE_USE, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPE| Modifier | Constructor and Description |
|---|---|
|
TypeVariableBinding(char[] sourceName,
Binding declaringElement,
int rank,
LookupEnvironment environment) |
protected |
TypeVariableBinding(char[] sourceName,
LookupEnvironment environment) |
|
TypeVariableBinding(TypeVariableBinding prototype) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptsNonNullDefault()
Used to implement this sentence from o.e.j.annotation.DefaultLocation:
"Wildcards and the use of type variables are always excluded from NonNullByDefault."
|
java.lang.String |
annotatedDebugName() |
protected void |
appendNullAnnotation(java.lang.StringBuffer nameBuffer,
CompilerOptions options) |
int |
boundCheck(Substitution substitution,
TypeBinding argumentType,
Scope scope)
Returns true if the argument type satisfies all bounds of the type parameter
|
int |
boundsCount() |
boolean |
canBeInstantiated()
Answer true if the receiver can be instantiated
|
TypeBinding |
clone(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.
|
TypeBinding |
combineTypeAnnotations(TypeBinding substitute) |
char[] |
computeUniqueKey(boolean isLeaf)
p.X
|
char[] |
constantPoolName()
Answer the receiver's constant pool name.
|
java.lang.String |
debugName() |
boolean |
enterRecursiveFunction()
Call this before descending into type details to prevent infinite recursion.
|
TypeBinding |
erasure() |
void |
evaluateNullAnnotations(Scope scope,
TypeParameter parameter) |
void |
exitRecursiveFunction()
Exit the context of a potentially recursive function.
|
char[] |
genericSignature()
T::Ljava/util/Map;:Ljava/io/Serializable;
T:LY
|
char[] |
genericTypeSignature()
T::Ljava/util/Map;:Ljava/io/Serializable;
T:LY
|
protected TypeBinding[] |
getDerivedTypesForDeferredInitialization() |
boolean |
hasTypeBit(int bit)
Answer an additional bit characterizing this type, like
TypeIds.BitAutoCloseable. |
boolean |
isErasureBoundTo(TypeBinding type)
Returns true if the type variable is directly bound to a given type
|
boolean |
isHierarchyConnected()
Returns true if the type hierarchy is connected
|
boolean |
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:
|
boolean |
isProperType(boolean admitCapture18)
JLS8 Sect 18.1.1
|
boolean |
isSubtypeOf(TypeBinding other) |
boolean |
isTypeVariable()
Returns true if the type was declared as a type variable
|
int |
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.
|
TypeBinding[] |
otherUpperBounds() |
char[] |
readableName()
Answer the receiver's signature.
|
TypeBinding |
setFirstBound(TypeBinding firstBound) |
ReferenceBinding |
setSuperClass(ReferenceBinding superclass) |
ReferenceBinding[] |
setSuperInterfaces(ReferenceBinding[] superInterfaces) |
void |
setTypeAnnotations(AnnotationBinding[] annotations,
boolean evalNullAnnotations) |
char[] |
shortReadableName() |
ReferenceBinding |
superclass() |
ReferenceBinding[] |
superInterfaces() |
java.lang.String |
toString() |
TypeBinding |
unannotated()
Return this type minus its type annotations
|
TypeBinding |
upperBound()
Upper bound doesn't perform erasure
|
TypeBinding |
withoutToplevelNullAnnotation()
Return this type minus its toplevel null annotations.
|
applyCloseableClassWhitelists, applyCloseableInterfaceWhitelists, availableFields, availableMethods, binarySearch, binarySearch, canBeSeenBy, canBeSeenBy, canBeSeenBy, computeGenericTypeSignature, computeId, computeId, depth, detectAnnotationCycle, enclosingTypeAt, enumConstantCount, fieldCount, fields, getAccessFlags, getAnnotations, getAnnotationTagBits, getEnclosingInstancesSlotSize, getExactConstructor, getExactMethod, getField, getField, getFileName, getMemberType, getMethods, getMethods, getOuterLocalVariablesSlotSize, getPackage, getSingleAbstractMethod, getTypeVariable, hashCode, hasIncompatibleSuperType, hasMemberTypes, hasRestrictedAccess, implementsInterface, innerCanBeSeenBy, innerCanBeSeenBy, isAbstract, isAnnotationType, isBinaryBinding, isClass, isCompatibleWith, isConsistentIntersection, isDefault, isDeprecated, isEnum, isFinal, isFunctionalInterface, isHierarchyBeingActivelyConnected, isHierarchyBeingConnected, isInterface, isOrEnclosedByPrivateType, isPrivate, isProtected, isPublic, isStatic, isStrictfp, isSubTypeOfRTL, isSuperclassOf, isThrowable, isUncheckedException, isUsed, isViewedAsDeprecated, memberTypes, methods, outermostEnclosingType, qualifiedSourceName, retrieveAnnotationHolder, setAnnotations, setContainerAnnotationType, signature, sortFields, sortMethods, sourceName, syntheticEnclosingInstanceTypes, tagAsHavingDefectiveContainerType, unResolvedFieldsactualType, capture, closestMatch, collectMissingTypes, containerAnnotationType, dimensions, enclosingMethod, enclosingType, equalsEquals, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, getErasureCompatibleType, getIntersectingTypes, getTypeAnnotations, hasNullTypeAnnotations, hasTypeAnnotations, 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, isReifiable, isRepeatableAnnotationType, isTypeArgumentContainedBy, isUnboundWildcard, isUnresolvedType, isWildcard, leafComponentType, needsUncheckedConversion, notEquals, original, prototype, qualifiedPackageName, signableName, sIsMoreSpecific, swapUnresolved, syntheticOuterLocalVariables, typeVariables, uncapture, wellKnownTypecomputeUniqueKey, initializeDeprecatedAnnotationTagBits, isParameter, isTaggedRepeatable, isValidBinding, isVolatile, problemId, setAnnotationspublic Binding declaringElement
public int rank
public TypeBinding firstBound
public ReferenceBinding superclass
public ReferenceBinding[] superInterfaces
public char[] genericTypeSignature
public TypeVariableBinding(char[] sourceName,
Binding declaringElement,
int rank,
LookupEnvironment environment)
protected TypeVariableBinding(char[] sourceName,
LookupEnvironment environment)
public TypeVariableBinding(TypeVariableBinding prototype)
public int boundCheck(Substitution substitution, TypeBinding argumentType, Scope scope)
public int boundsCount()
public boolean canBeInstantiated()
ReferenceBindingcanBeInstantiated in class ReferenceBindingReferenceBinding.canBeInstantiated()public void collectSubstitutes(Scope scope, TypeBinding actualType, InferenceContext inferenceContext, int constraint)
collectSubstitutes in class TypeBindingpublic char[] computeUniqueKey(boolean isLeaf)
ReferenceBindingcomputeUniqueKey in class ReferenceBindingpublic char[] constantPoolName()
ReferenceBindingconstantPoolName in class ReferenceBindingpublic TypeBinding clone(TypeBinding enclosingType)
TypeBindingclone in class TypeBindingpublic java.lang.String annotatedDebugName()
annotatedDebugName in class TypeBindingpublic java.lang.String debugName()
debugName in class ReferenceBindingTypeBinding.debugName()public TypeBinding erasure()
erasure in class TypeBindingpublic char[] genericSignature()
public char[] genericTypeSignature()
genericTypeSignature in class TypeBindingpublic boolean hasTypeBit(int bit)
TypeBindingTypeIds.BitAutoCloseable.hasTypeBit in class TypeBindingpublic boolean isErasureBoundTo(TypeBinding type)
public boolean isHierarchyConnected()
ReferenceBindingisHierarchyConnected in class ReferenceBindingpublic boolean isInterchangeableWith(TypeVariableBinding otherVariable, Substitution substitute)
public boolean isSubtypeOf(TypeBinding other)
isSubtypeOf in class ReferenceBindingpublic boolean enterRecursiveFunction()
TypeBindingenterRecursiveFunction in class TypeBindingpublic void exitRecursiveFunction()
TypeBindingexitRecursiveFunction in class TypeBindingpublic boolean isProperType(boolean admitCapture18)
TypeBindingisProperType in class ReferenceBindingadmitCapture18 - request if CaptureBinding18 shuld be considered as a proper type.
If unsure say 'true', only in Scope.greaterLowerBound(TypeBinding[], Scope, LookupEnvironment)
CaptureBinding18 has to be excluded to prevent an NPE on a branch that heuristically tries to avoid
inconsistent intersections.public boolean isTypeVariable()
isTypeVariable in class TypeBindingpublic int kind()
kind in class TypeBindingpublic boolean mentionsAny(TypeBinding[] parameters, int idx)
TypeBindingmentionsAny in class TypeBindingpublic TypeBinding[] otherUpperBounds()
public char[] readableName()
ReferenceBindingreadableName in class ReferenceBindingReferenceBinding.readableName()public void setTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations)
setTypeAnnotations in class TypeBindingpublic char[] shortReadableName()
shortReadableName in class ReferenceBindingReferenceBinding.shortReadableName()public ReferenceBinding superclass()
superclass in class ReferenceBindingpublic ReferenceBinding[] superInterfaces()
superInterfaces in class ReferenceBindingpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames)
TypeBindingnullAnnotatedReadableName in class ReferenceBindingTypeBinding.nullAnnotatedReadableName(CompilerOptions,boolean)protected void appendNullAnnotation(java.lang.StringBuffer nameBuffer,
CompilerOptions options)
appendNullAnnotation in class ReferenceBindingpublic TypeBinding unannotated()
TypeBindingunannotated in class TypeBindingpublic TypeBinding withoutToplevelNullAnnotation()
TypeBindingwithoutToplevelNullAnnotation in class TypeBindingpublic TypeBinding upperBound()
public void evaluateNullAnnotations(Scope scope, TypeParameter parameter)
public TypeBinding setFirstBound(TypeBinding firstBound)
public ReferenceBinding setSuperClass(ReferenceBinding superclass)
public ReferenceBinding[] setSuperInterfaces(ReferenceBinding[] superInterfaces)
protected TypeBinding[] getDerivedTypesForDeferredInitialization()
public TypeBinding combineTypeAnnotations(TypeBinding substitute)
public boolean acceptsNonNullDefault()
TypeBindingacceptsNonNullDefault in class ReferenceBinding