Class BaseTypeBinding
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.BaseTypeBinding
- Direct Known Subclasses:
NullTypeBinding, VoidTypeBinding
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int[]static final intstatic final intstatic final intchar[]static final intFields inherited from class TypeBinding
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, id, INT, LONG, NULL, NUMERIC_TYPES, SHORT, TYPE_USE_BINDING, typeAnnotations, VOIDModifier and TypeFieldDescriptionstatic final BaseTypeBindingstatic final BaseTypeBindingstatic final BaseTypeBindingstatic final BaseTypeBindingstatic final BaseTypeBindingintstatic final BaseTypeBindingBase type definitionsstatic final BaseTypeBindingstatic final NullTypeBindingstatic final TypeBinding[]static final BaseTypeBindingstatic final ReferenceBindingprotected AnnotationBinding[]static final VoidTypeBindingFields inherited from class Binding
ANY_EXCEPTION, ARRAY_TYPE, AWAITED_ANNOTATIONS, BASE_TYPE, DefaultLocationArrayContents, DefaultLocationField, DefaultLocationParameter, DefaultLocationRecordComponent, DefaultLocationReturnType, DefaultLocationsForTrueValue, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, extendedTagBits, 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_PERMITTED_TYPES, 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, tagBits, TYPE, TYPE_PARAMETER, TYPE_USE, UNINITIALIZED_COMPONENTS, UNINITIALIZED_FIELDS, UNINITIALIZED_METHODS, UNINITIALIZED_REFERENCE_TYPES, VARIABLE, WILDCARD_TYPEModifier and TypeFieldDescriptionstatic final ReferenceBinding[]static final intstatic final AnnotationBinding[]static final intstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#ARRAY_CONTENTSstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#FIELDstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#PARAMETERstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#RECORD_COMPONENTstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#RETURN_TYPEstatic final intstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#TYPE_ARGUMENTstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#TYPE_BOUNDstatic final intBit in defaultNullness bit vectors, representing the enum constant DefaultLocation#TYPE_PARAMETERintstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final AnnotationBinding[]static final RecordComponentBinding[]static final ElementValuePair[]static final ReferenceBinding[]static final FieldBinding[]static final ReferenceBinding[]static final MethodBinding[]static final ModuleBinding[]static final intstatic final PackageBinding[]static final char[][]static final TypeBinding[]static final ReferenceBinding[]static final PlainPackageBinding[]static final ReferenceBinding[]static final ReferenceBinding[]static final TypeVariableBinding[]static final TypeBinding[]static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intlongstatic final intstatic final intstatic final intstatic final RecordComponentBinding[]static final FieldBinding[]static final MethodBinding[]static final ReferenceBinding[]static final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionclone(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.char[]computeUniqueKey(boolean isLeaf) int -> Ichar[]Answer the receiver's constant pool name.static final intgetRightToLeft(int left, int right) static final int[]final booleanisCompatibleWith(TypeBinding right, Scope captureScope) static final booleanisExactWidening(int left, int right) Predicate telling whether "left" can store a "right" using some widening conversion and whether it is an exact widening conversion https://cr.openjdk.org/~abimpoudis/instanceof/jep455-20240424/specs/instanceof-jls.html#jls-5.1.2 (is left bigger than right)final booleanisIntegralType(int tid) static final booleanisNarrowing(int left, int right) Predicate telling whether "left" can store a "right" using some narrowing conversion (is left smaller than right)booleanisUncheckedException(boolean includeSupertype) T_null is acting as an unchecked exceptionstatic final booleanisWidening(int left, int right) Predicate telling whether "left" can store a "right" using some widening conversion (is left bigger than right)static final booleanisWideningAndNarrowing(int left, int right) Predicate telling whether its a widening followed by narrowing conversion - as per section 5.1.4 applicable for byte to charintkind()char[]Answer the source name for the type.char[]voidsetTypeAnnotations(AnnotationBinding[] annotations, boolean evalNullAnnotations) char[]char[]toString()Return this type minus its type annotationsMethods inherited from class TypeBinding
acceptsNonNullDefault, actualType, annotatedDebugName, canBeInstantiated, canBeSeenBy, capture, closestMatch, collectMissingTypes, components, containerAnnotationType, debugName, depth, dimensions, downwardsProjection, enclosingMethod, enclosingType, enterRecursiveFunction, enumConstantCount, equalsEquals, erasure, exitRecursiveFunction, fields, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, genericTypeSignature, getErasureCompatibleType, getIntersectingTypes, getMethods, getSingleAbstractMethod, getTypeAnnotations, hasEnclosingInstanceContext, hasNullTypeAnnotations, hasTypeAnnotations, hasTypeBit, hasValueBasedTypeAnnotation, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isBoxedPrimitiveType, isBoxingCompatibleWith, isCapture, isClass, isCompatibleWith, isEnum, isEquivalentTo, isFreeTypeVariable, isFunctionalInterface, isFunctionalType, isGenericType, isHierarchyInconsistent, isInterface, isIntersectionType, isIntersectionType18, isLocalType, isMemberType, isNestedType, isNonDenotable, isNumericType, isParameterizedType, isParameterizedTypeWithActualArguments, isParameterizedWithOwnVariables, isPolyType, isPotentiallyCompatibleWith, isPrimitiveOrBoxedPrimitiveType, isPrimitiveType, isProperType, isProvablyDistinct, isRawType, isReadyForAnnotations, isRecord, isRecordWithComponents, isReifiable, isRepeatableAnnotationType, isSealed, isStatic, isSubtypeOf, isThrowable, isTypeArgumentContainedBy, isTypeVariable, isUnboundWildcard, isUnresolvedType, isWildcard, leafComponentType, mentionsAny, needsUncheckedConversion, notEquals, nullAnnotatedReadableName, original, permittedTypes, prototype, qualifiedPackageName, signableName, signature, sIsMoreSpecific, superclass, superInterfaces, syntheticOuterLocalVariables, syntheticTypeVariablesMentioned, typeArgumentDepth, typeVariables, unboxedType, uncapture, updateTagBits, upwardsProjection, upwardsProjection, wellKnownBaseType, wellKnownType, withoutToplevelNullAnnotationModifier and TypeMethodDescriptionbooleanUsed to implement this sentence from o.e.j.annotation.DefaultLocation: "Wildcards and the use of type variables are always excluded from NonNullByDefault."booleanbooleancanBeSeenBy(Scope scope) Perform capture conversion on a given type (only effective on parameterized type with wildcards)In case of problems, returns the closest match found.collectMissingTypes(List<TypeBinding> missingTypes) Iterate through the type components to collect instances of leaf missing typesintdepth()intdownwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) Perform a downwards type projection as per JLS 4.10.5booleanCall this before descending into type details to prevent infinite recursion.intstatic booleanequalsEquals(TypeBinding that, TypeBinding other) erasure()voidExit the context of a potentially recursive function.fields()findSuperTypeOriginatingFrom(int wellKnownOriginalID, boolean originalIsClass) Find supertype which originates from a given well-known type, or null if not found (using id avoids triggering the load of well-known type: 73740) NOTE: only works for erasures of well-known types, as random other types may share same id though being distincts.findSuperTypeOriginatingFrom(TypeBinding otherType) Find supertype which originates from a given type, or null if not foundgenericCast(TypeBinding targetType) Returns the type to use for generic cast, or null if none requiredchar[]Answer the receiver classfile signature.getErasureCompatibleType(TypeBinding declaringClass) Return the supertype which would erase as a subtype of a given declaring class.getMethods(char[] selector) getSingleAbstractMethod(Scope scope, boolean replaceWildcards) Return the single abstract method of a functional interface, or one ofnullorReferenceBinding.samProblemBinding, if the receiver is not a functional interface as defined in JLS 9.8.final AnnotationBinding[]booleanbooleanDoes this type or any of its details (array dimensions, type arguments) have a null type annotation?final booleanbooleanhasTypeBit(int bit) Answer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable.booleanfinal booleanfinal booleanfinal booleanbooleanReturns true if parameterized type AND not of the formList<?>booleanbooleanisBoxingCompatibleWith(TypeBinding right, Scope scope) booleanReturns true if the type is the capture of some wildcardbooleanisClass()booleanisCompatibleWith(TypeBinding right) booleanisEnum()booleanisEquivalentTo(TypeBinding otherType) Returns true if a type is identical to another one, or for generic types, true if compared to its raw type.booleanbooleanisFunctionalInterface(Scope scope) booleanbooleanfinal booleanbooleanbooleanReturns true if the current type denotes an intersection type: Number andComparable<?>booleanfinal booleanfinal booleanfinal booleanbooleanDoes this type lack a class file representation on its own ?final booleanbooleanReturns true if the type is parameterized, e.g.final booleanReturns true if the type is parameterized, e.g.booleanReturns true if the type is parameterized using its own type variables as argumentsbooleanbooleanisPotentiallyCompatibleWith(TypeBinding right, Scope scope) final booleanfinal booleanbooleanisProperType(boolean admitCapture18) JLS8 Sect 18.1.1booleanisProvablyDistinct(TypeBinding otherType) Returns true if a type is provably distinct from another one,final booleanbooleanbooleanisRecord()booleanbooleanJLS(3) 4.7.booleanAnswer true if the receiver is an annotation which may be repeatable.booleanisSealed()booleanisStatic()Answer true if the receiver is a static member type (or toplevel)booleanisSubtypeOf(TypeBinding right, boolean simulatingBugJDK8026527) booleanReturns true if a given type may be thrownbooleanisTypeArgumentContainedBy(TypeBinding otherType) booleanReturns true if the type was declared as a type variablebooleanReturns true if wildcard type of the form '?' (no bound)booleanbooleanReturns true if the type is a wildcardbooleanmentionsAny(TypeBinding[] parameters, int idx) Does this type mention any of the given type parameters, except the one at position 'idx'?booleanneedsUncheckedConversion(TypeBinding targetType) Meant to be invoked on compatible types, to figure if unchecked conversion is necessarystatic booleannotEquals(TypeBinding that, TypeBinding other) char[]nullAnnotatedReadableName(CompilerOptions options, boolean shortNames) Answer a readable name (for error reporting) that includes nullness type annotations.original()Returns the orignal generic type instantiated by the receiver type, or itself if not.Return the primordial type from which the receiver was cloned.char[]Answer the qualified name of the receiver's package separated by periods or an empty string if its the default package.char[]char[]Answer the receiver classfile signature.booleansIsMoreSpecific(TypeBinding s, TypeBinding t, Scope scope) intPerform capture "deconversion" on a given typelongRefresh some tagBits from details into the main type.upwardsProjection(Scope scope) Perform an upwards type projection as per JLS 4.10.5upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables) Perform an upwards type projection as per JLS 4.10.5static final TypeBindingwellKnownBaseType(int id) static final TypeBindingwellKnownType(Scope scope, int id) Match a well-known type id to its bindingReturn this type minus its toplevel null annotations.Methods inherited from class Binding
computeUniqueKey, getAnnotations, getAnnotationTagBits, initializeDeprecatedAnnotationTagBits, isAnnotationType, isParameter, isPatternVariable, isTaggedRepeatable, isValid, isValidBinding, isVolatile, problemId, setAnnotations, setAnnotationsModifier and TypeMethodDescriptionchar[]longCompute the tagbits for standard annotations.voidCompute the tag bits for @Deprecated annotations, avoiding resolving entire annotation if not necessary.booleanbooleanbooleanbooleanstatic booleanfinal booleanbooleanintvoidsetAnnotations(AnnotationBinding[] annotations, boolean forceStore) voidsetAnnotations(AnnotationBinding[] annotations, Scope scope, boolean forceStore)
-
Field Details
-
CONVERSIONS
public static final int[] CONVERSIONS -
IDENTITY
public static final int IDENTITY- See Also:
-
WIDENING
public static final int WIDENING- See Also:
-
NARROWING
public static final int NARROWING- See Also:
-
MAX_CONVERSIONS
public static final int MAX_CONVERSIONS- See Also:
-
simpleName
public char[] simpleName
-
-
Method Details
-
initializeConversions
public static final int[] initializeConversions() -
isWidening
public static final boolean isWidening(int left, int right) Predicate telling whether "left" can store a "right" using some widening conversion (is left bigger than right)- Parameters:
left- - the target type to convert toright- - the actual type- Returns:
- true if legal widening conversion
-
isNarrowing
public static final boolean isNarrowing(int left, int right) Predicate telling whether "left" can store a "right" using some narrowing conversion (is left smaller than right)- Parameters:
left- - the target type to convert toright- - the actual type- Returns:
- true if legal narrowing conversion
-
isWideningAndNarrowing
public static final boolean isWideningAndNarrowing(int left, int right) Predicate telling whether its a widening followed by narrowing conversion - as per section 5.1.4 applicable for byte to char- Parameters:
left- - the target type to convert toright- - the actual type- Returns:
- true if widening and narrowing conversion
-
isExactWidening
public static final boolean isExactWidening(int left, int right) Predicate telling whether "left" can store a "right" using some widening conversion and whether it is an exact widening conversion https://cr.openjdk.org/~abimpoudis/instanceof/jep455-20240424/specs/instanceof-jls.html#jls-5.1.2 (is left bigger than right)- Parameters:
left- - the target type to convert toright- - the actual type- Returns:
- true if legal widening conversion
-
getRightToLeft
public static final int getRightToLeft(int left, int right) - Parameters:
left- - the target type to convert toright- - the actual type- Returns:
- return the conversion index
-
isIntegralType
public final boolean isIntegralType(int tid) -
computeUniqueKey
public char[] computeUniqueKey(boolean isLeaf) int -> I- Overrides:
computeUniqueKeyin classBinding
-
constantPoolName
public char[] constantPoolName()Description copied from class:TypeBindingAnswer the receiver's constant pool name. NOTE: This method should only be used during/after code gen. e.g. 'java/lang/Object'- Specified by:
constantPoolNamein classTypeBinding
-
clone
Description copied from class:TypeBindingVirtual 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:
clonein classTypeBinding
-
getPackage
- Specified by:
getPackagein classTypeBinding
-
isCompatibleWith
- Specified by:
isCompatibleWithin classTypeBinding
-
setTypeAnnotations
- Overrides:
setTypeAnnotationsin classTypeBinding
-
unannotated
Description copied from class:TypeBindingReturn this type minus its type annotations- Overrides:
unannotatedin classTypeBinding
-
isUncheckedException
public boolean isUncheckedException(boolean includeSupertype) T_null is acting as an unchecked exception- Overrides:
isUncheckedExceptionin classTypeBinding- See Also:
-
kind
public int kind()- Overrides:
kindin classTypeBinding- See Also:
-
qualifiedSourceName
public char[] qualifiedSourceName()Description copied from class:TypeBindingAnswer the source name for the type. In the case of member types, as the qualified name from its top level type. For example, for a member type N defined insideM & A: "A.M.N".- Specified by:
qualifiedSourceNamein classTypeBinding
-
readableName
public char[] readableName()- Specified by:
readableNamein classBinding
-
shortReadableName
public char[] shortReadableName()- Overrides:
shortReadableNamein classBinding
-
sourceName
public char[] sourceName()- Specified by:
sourceNamein classTypeBinding
-
toString
-