Class SourceTypeBinding
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.SourceTypeBinding
- Direct Known Subclasses:
BinaryTypeBinding
,HelperInterfaceBinding
,NestedTypeBinding
-
Field Summary
Modifier and TypeFieldDescriptionint
boolean
protected SourceTypeBinding
protected SourceTypeBinding
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
ConstructorDescriptionSourceTypeBinding
(char[][] compoundName, PackageBinding fPackage, ClassScope scope) SourceTypeBinding
(SourceTypeBinding prototype) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addField
(FieldBinding binding) void
addMethod
(MethodBinding binding) addSyntheticArrayMethod
(ArrayBinding arrayType, int purpose, char[] selector) addSyntheticBridgeMethod
(MethodBinding inheritedMethodToBridge) addSyntheticBridgeMethod
(MethodBinding inheritedMethodToBridge, MethodBinding targetMethod) addSyntheticEnumMethod
(char[] selector) addSyntheticFactoryMethod
(MethodBinding privateConstructor, MethodBinding publicConstructor, TypeBinding[] enclosingInstances, char[] selector) addSyntheticFieldForAssert
(BlockScope blockScope) addSyntheticFieldForClassLiteral
(TypeBinding targetType, BlockScope blockScope) addSyntheticFieldForInnerclass
(LocalVariableBinding actualOuterLocalVariable) addSyntheticFieldForInnerclass
(ReferenceBinding enclosingType) addSyntheticFieldForSwitchEnum
(char[] fieldName, String key) addSyntheticMethod
(LambdaExpression lambda) addSyntheticMethod
(FieldBinding targetField, boolean isReadAccess, boolean isSuperAccess) addSyntheticMethod
(MethodBinding targetMethod, boolean isSuperAccess) addSyntheticMethodForEnumInitialization
(int begin, int end) addSyntheticMethodForSwitchEnum
(TypeBinding enumBinding, SwitchStatement switchStatement) addSyntheticRecordComponentAccessor
(RecordComponentBinding rcb, int index) addSyntheticRecordOverrideMethod
(char[] selector, int index) boolean
canBeSeenBy
(Scope sco) Answer true if the receiver is visible to the type provided by the scope.checkAndAddSyntheticRecordComponentAccessors
(MethodBinding[] methodBindings) checkAndAddSyntheticRecordMethods
(MethodBinding[] methodBindings, int count) checkAndAddSyntheticRecordOverrideMethods
(MethodBinding[] methodBindings, List<MethodBinding> implicitMethods) void
cleanUp()
clone
(TypeBinding immaterial) 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.collectAllTypeBindings
(TypeDeclaration typeDecl, CompilationUnitScope unitScope) void
char[]
computeUniqueKey
(boolean isLeaf) p.X<T extends Y & I, U extends Y> -> Lp/X<TT;TU;>;
void
fields()
void
generateSyntheticFinalFieldInitialization
(CodeStream codeStream) char[]
<param1 ... paramN>superclass superinterface1 ... superinterfaceN <T:LY<TT;>;U:Ljava/lang/Object;V::Ljava/lang/Runnable;:Ljava/lang/Cloneable;:Ljava/util/Map;>Ljava/lang/Exception;Ljava/lang/Runnable;
char[]
Answer the receiver classfile signature.long
Compute the tagbits for standard annotations.getComponent
(char[] componentName, boolean needResolve) getExactConstructor
(TypeBinding[] argumentTypes) getExactMethod
(char[] selector, TypeBinding[] argumentTypes, CompilationUnitScope refScope) getExactMethodBase
(char[] selector, TypeBinding[] argumentTypes, CompilationUnitScope refScope) getField
(char[] fieldName, boolean needResolve) getField
(char[] fieldName, boolean needResolve, InvocationSite site, Scope scope) Where multiple fields with the same name are defined, this will return the one most visible one...getFieldBase
(char[] fieldName, boolean needResolve) getMemberType
(char[] typeName) Find the member type with the given simple typeName.getMethods
(char[] selector) getMethods
(char[] selector, int suggestedParameterLength) getMethodsBase
(char[] selector) getRecordComponent
(char[] name) getRecordComponentAccessor
(char[] name) Get the accessor method given the record component namegetSyntheticBridgeMethod
(MethodBinding inheritedMethodToBridge) getSyntheticField
(LocalVariableBinding actualOuterLocalVariable) getSyntheticField
(ReferenceBinding targetEnclosingType, boolean onlyExactMatch) boolean
protected boolean
hasMethodWithNumArgs
(char[] selector, int numArgs) boolean
hasTypeBit
(int bit) Answer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable
.void
Compute the tag bits for @Deprecated annotations, avoiding resolving entire annotation if not necessary.boolean
isEquivalentTo
(TypeBinding otherType) Returns true if a type is identical to another one, or for generic types, true if compared to its raw type.boolean
boolean
Returns true if the type hierarchy is connectedboolean
isNestmateOf
(SourceTypeBinding other) boolean
boolean
boolean
isRecord()
boolean
Answer true if the receiver is an annotation which may be repeatable.boolean
int
kind()
Returns the member types of this type sorted by simple name.methods()
module()
Return the primordial type from which the receiver was cloned.void
void
removeMethod
(int index) void
removeSyntheticRecordCanonicalConstructor
(SyntheticMethodBinding implicitCanonicalConstructor) resolveTypeFor
(FieldBinding field) resolveTypeFor
(RecordComponentBinding component) resolveTypesFor
(MethodBinding method) retrieveAnnotationHolder
(Binding binding, boolean forceInitialization) setComponents
(RecordComponentBinding[] comps) void
setFields
(FieldBinding[] fields) setMemberTypes
(ReferenceBinding[] memberTypes) setMethods
(MethodBinding[] methods) void
setNestHost
(SourceTypeBinding nestHost) setPermittedTypes
(ReferenceBinding[] permittedTypes) setSuperClass
(ReferenceBinding superClass) setSuperInterfaces
(ReferenceBinding[] superInterfaces) setTypeVariables
(TypeVariableBinding[] typeVariables) int
int
Answer the collection of synthetic fields to append into the classfilevoid
void
toString()
Return this type minus its type annotationsReturn this type minus its toplevel null annotations.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
acceptsNonNullDefault, appendNullAnnotation, applyCloseableClassWhitelists, applyCloseableInterfaceWhitelists, availableFields, availableMethods, binarySearch, binarySearch, canBeInstantiated, canBeSeenBy, canBeSeenBy, computeGenericTypeSignature, computeId, computeId, constantPoolName, debugName, depth, detectAnnotationCycle, detectWrapperResource, downwardsProjection, enclosingTypeAt, enumConstantCount, fieldCount, getAccessFlags, getAnnotations, getEnclosingInstancesSlotSize, getFileName, getInterfaceAbstractContracts, getOuterLocalVariablesSlotSize, getPackage, getSingleAbstractMethod, getTypeVariable, hasEnclosingInstanceContext, hashCode, hasHierarchyCheckStarted, hasIncompatibleSuperType, hasNullBit, hasRestrictedAccess, implementsInterface, innerCanBeSeenBy, innerCanBeSeenBy, isAbstract, isAnnotationType, isBinaryBinding, isClass, isCompatibleWith, isConsistentIntersection, isDefault, isDeprecated, isEnum, isFieldInitializationFinished, isFinal, isFunctionalInterface, isHierarchyBeingActivelyConnected, isHierarchyBeingConnected, isInterface, isNestmateOf, isNonSealed, isOrEnclosedByPrivateType, isPrivate, isProperType, isProtected, isPublic, isSealed, isStatic, isStrictfp, isSubtypeOf, isSubTypeOfRTL, isSuperclassOf, isThrowable, isUncheckedException, isUsed, isViewedAsDeprecated, nullAnnotatedReadableName, outermostEnclosingType, qualifiedSourceName, readableName, readableName, setAnnotations, setHierarchyCheckDone, shortReadableName, shortReadableName, signature, sortFields, sortMethods, sourceName, syntheticEnclosingInstanceTypes, upwardsProjection
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
actualType, annotatedDebugName, capture, closestMatch, collectMissingTypes, collectSubstitutes, dimensions, enclosingMethod, enclosingType, enterRecursiveFunction, equalsEquals, erasure, exitRecursiveFunction, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, getErasureCompatibleType, getIntersectingTypes, getTypeAnnotations, hasNullTypeAnnotations, hasTypeAnnotations, hasValueBasedTypeAnnotation, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isBoxedPrimitiveType, isBoxingCompatibleWith, isCapture, isCompatibleWith, isFreeTypeVariable, isFunctionalType, isHierarchyInconsistent, isIntersectionType, isIntersectionType18, isLocalType, isMemberType, isNestedType, isNonDenotable, isNumericType, isParameterizedType, isParameterizedTypeWithActualArguments, isParameterizedWithOwnVariables, isPolyType, isPotentiallyCompatibleWith, isPrimitiveOrBoxedPrimitiveType, isPrimitiveType, isProvablyDistinct, isRawType, isReifiable, isTypeArgumentContainedBy, isTypeVariable, isUnboundWildcard, isUnresolvedType, isWildcard, leafComponentType, mentionsAny, needsUncheckedConversion, notEquals, original, qualifiedPackageName, setTypeAnnotations, signableName, sIsMoreSpecific, swapUnresolved, syntheticOuterLocalVariables, uncapture, updateTagBits, wellKnownBaseType, wellKnownType
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, isParameter, isPatternVariable, isValid, isValidBinding, isVolatile, problemId, setAnnotations
-
Field Details
-
superclass
-
superInterfaces
-
fields
-
components
-
methods
-
memberTypes
-
typeVariables
-
permittedTypes
-
originalSuperclass
-
originalSuperInterfaces
-
privilegedHandler
-
memberFinder
-
typeFinder
-
scope
-
prototype
-
module
-
defaultNullness
public int defaultNullness -
externalAnnotationProvider
-
nestHost
-
isVarArgs
public boolean isVarArgs
-
-
Constructor Details
-
SourceTypeBinding
public SourceTypeBinding() -
SourceTypeBinding
-
SourceTypeBinding
-
-
Method Details
-
addSyntheticFieldForInnerclass
-
addSyntheticFieldForInnerclass
-
addSyntheticFieldForClassLiteral
-
addSyntheticFieldForAssert
-
addSyntheticFieldForEnumValues
-
addSyntheticField
-
addSyntheticMethod
public SyntheticMethodBinding addSyntheticMethod(FieldBinding targetField, boolean isReadAccess, boolean isSuperAccess) -
addSyntheticEnumMethod
-
addSyntheticFieldForSwitchEnum
-
addSyntheticMethodForSwitchEnum
public SyntheticMethodBinding addSyntheticMethodForSwitchEnum(TypeBinding enumBinding, SwitchStatement switchStatement) -
addSyntheticMethodForEnumInitialization
-
addSyntheticMethod
-
addSyntheticMethod
-
addSyntheticMethod
-
addSyntheticArrayMethod
public SyntheticMethodBinding addSyntheticArrayMethod(ArrayBinding arrayType, int purpose, char[] selector) -
addSyntheticFactoryMethod
public SyntheticMethodBinding addSyntheticFactoryMethod(MethodBinding privateConstructor, MethodBinding publicConstructor, TypeBinding[] enclosingInstances, char[] selector) -
addSyntheticBridgeMethod
public SyntheticMethodBinding addSyntheticBridgeMethod(MethodBinding inheritedMethodToBridge, MethodBinding targetMethod) -
addSyntheticBridgeMethod
-
checkAndAddSyntheticRecordMethods
-
checkAndAddSyntheticRecordOverrideMethods
public List<MethodBinding> checkAndAddSyntheticRecordOverrideMethods(MethodBinding[] methodBindings, List<MethodBinding> implicitMethods) -
checkAndAddSyntheticRecordComponentAccessors
public List<MethodBinding> checkAndAddSyntheticRecordComponentAccessors(MethodBinding[] methodBindings) -
addSyntheticRecordCanonicalConstructor
-
removeSyntheticRecordCanonicalConstructor
public void removeSyntheticRecordCanonicalConstructor(SyntheticMethodBinding implicitCanonicalConstructor) -
addSyntheticRecordComponentAccessor
public SyntheticMethodBinding addSyntheticRecordComponentAccessor(RecordComponentBinding rcb, int index) -
addSyntheticRecordOverrideMethod
-
kind
public int kind()- Overrides:
kind
in classTypeBinding
-
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
-
computeUniqueKey
public char[] computeUniqueKey(boolean isLeaf) Description copied from class:ReferenceBinding
p.X<T extends Y & I, U extends Y> -> Lp/X<TT;TU;>;
- Overrides:
computeUniqueKey
in classReferenceBinding
-
collectAllTypeBindings
public List<SourceTypeBinding> collectAllTypeBindings(TypeDeclaration typeDecl, CompilationUnitScope unitScope) -
components
- Overrides:
components
in classTypeBinding
-
resolveTypeFor
-
fields
- Overrides:
fields
in classReferenceBinding
-
genericTypeSignature
public char[] genericTypeSignature()Description copied from class:TypeBinding
Answer the receiver classfile signature. Arrays and base types do not distinguish between signature() and constantPoolName(). NOTE: This method should only be used during/after code gen.- Overrides:
genericTypeSignature
in classTypeBinding
- See Also:
-
genericSignature
public char[] genericSignature()<param1 ... paramN>superclass superinterface1 ... superinterfaceN <T:LY<TT;>;U:Ljava/lang/Object;V::Ljava/lang/Runnable;:Ljava/lang/Cloneable;:Ljava/util/Map;>Ljava/lang/Exception;Ljava/lang/Runnable;
-
getAnnotationTagBits
public long getAnnotationTagBits()Compute the tagbits for standard annotations. For source types, these could require lazily resolving corresponding annotation nodes, in case of forward references. For type use bindings, this method still returns the tagbits corresponding to the type declaration binding.- Overrides:
getAnnotationTagBits
in classReferenceBinding
- See Also:
-
isReadyForAnnotations
public boolean isReadyForAnnotations()- Overrides:
isReadyForAnnotations
in classTypeBinding
-
getDefaultAbstractMethods
-
getExactConstructor
- Overrides:
getExactConstructor
in classReferenceBinding
-
getExactMethod
public MethodBinding getExactMethod(char[] selector, TypeBinding[] argumentTypes, CompilationUnitScope refScope) - Overrides:
getExactMethod
in classReferenceBinding
-
getExactMethodBase
public MethodBinding getExactMethodBase(char[] selector, TypeBinding[] argumentTypes, CompilationUnitScope refScope) -
getField
- Overrides:
getField
in classReferenceBinding
-
getField
public FieldBinding getField(char[] fieldName, boolean needResolve, InvocationSite site, Scope scope) Description copied from class:ReferenceBinding
Where multiple fields with the same name are defined, this will return the one most visible one... Added for AspectJ to allow proper lookup with inter-type fields- Overrides:
getField
in classReferenceBinding
-
getFieldBase
-
getComponent
- Overrides:
getComponent
in classReferenceBinding
-
getMethods
- Overrides:
getMethods
in classReferenceBinding
-
getMethods
- Overrides:
getMethods
in classReferenceBinding
-
getMethodsBase
-
generateSyntheticFinalFieldInitialization
-
getSyntheticField
-
getSyntheticField
-
getSyntheticBridgeMethod
-
hasTypeBit
public boolean hasTypeBit(int bit) Description copied from class:TypeBinding
Answer an additional bit characterizing this type, likeTypeIds.BitAutoCloseable
.- Overrides:
hasTypeBit
in classTypeBinding
-
initializeDeprecatedAnnotationTagBits
public void initializeDeprecatedAnnotationTagBits()Description copied from class:Binding
Compute the tag bits for @Deprecated annotations, avoiding resolving entire annotation if not necessary.- Overrides:
initializeDeprecatedAnnotationTagBits
in classBinding
- See Also:
-
isEquivalentTo
Returns true if a type is identical to another one, or for generic types, true if compared to its raw type.- Overrides:
isEquivalentTo
in classTypeBinding
-
isGenericType
public boolean isGenericType()- Overrides:
isGenericType
in classTypeBinding
-
isHierarchyConnected
public boolean isHierarchyConnected()Description copied from class:ReferenceBinding
Returns true if the type hierarchy is connected- Overrides:
isHierarchyConnected
in classReferenceBinding
-
isRepeatableAnnotationType
public boolean isRepeatableAnnotationType()Description copied from class:TypeBinding
Answer true if the receiver is an annotation which may be repeatable. Overridden as appropriate.- Overrides:
isRepeatableAnnotationType
in classTypeBinding
-
isTaggedRepeatable
public boolean isTaggedRepeatable()- Overrides:
isTaggedRepeatable
in classBinding
-
canBeSeenBy
Description copied from class:ReferenceBinding
Answer true if the receiver is visible to the type provided by the scope.- Overrides:
canBeSeenBy
in classReferenceBinding
-
memberTypes
Description copied from class:ReferenceBinding
Returns the member types of this type sorted by simple name.- Overrides:
memberTypes
in classReferenceBinding
-
hasMemberTypes
public boolean hasMemberTypes()- Overrides:
hasMemberTypes
in classReferenceBinding
-
methodsBase
-
permittedTypes
- Overrides:
permittedTypes
in classReferenceBinding
-
prototype
Description copied from class:TypeBinding
Return the primordial type from which the receiver was cloned. Not all types track a prototype, onlySourceTypeBinding
,BinaryTypeBinding
andUnresolvedReferenceBinding
do so as of now. In fact some types e.gParameterizedTypeBinding
should not do so. Deflecting a query to a prototype would lead to wrong results in the case ofParameterizedTypeBinding
- Overrides:
prototype
in classTypeBinding
-
isPrototype
public boolean isPrototype() -
isRecord
public boolean isRecord()- Overrides:
isRecord
in classTypeBinding
-
containerAnnotationType
- Overrides:
containerAnnotationType
in classTypeBinding
-
resolveTypeFor
-
resolveTypesFor
-
evaluateNullAnnotations
public void evaluateNullAnnotations() -
hasMethodWithNumArgs
protected boolean hasMethodWithNumArgs(char[] selector, int numArgs) - Overrides:
hasMethodWithNumArgs
in classReferenceBinding
-
retrieveAnnotationHolder
- Overrides:
retrieveAnnotationHolder
in classReferenceBinding
-
setContainerAnnotationType
- Overrides:
setContainerAnnotationType
in classReferenceBinding
-
tagAsHavingDefectiveContainerType
public void tagAsHavingDefectiveContainerType()- Overrides:
tagAsHavingDefectiveContainerType
in classReferenceBinding
-
setComponents
-
setFields
-
setMemberTypes
-
setMethods
-
setPermittedTypes
-
setSuperClass
-
setSuperInterfaces
-
setTypeVariables
-
sourceEnd
public int sourceEnd() -
sourceStart
public int sourceStart() -
superclass
- Overrides:
superclass
in classReferenceBinding
-
superInterfaces
- Overrides:
superInterfaces
in classReferenceBinding
-
syntheticMethods
-
syntheticFields
Answer the collection of synthetic fields to append into the classfile -
toString
-
typeVariables
- Overrides:
typeVariables
in classTypeBinding
-
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
-
unResolvedFields
- Overrides:
unResolvedFields
in classReferenceBinding
-
unResolvedComponents
- Overrides:
unResolvedComponents
in classReferenceBinding
-
tagIndirectlyAccessibleMembers
public void tagIndirectlyAccessibleMembers() -
module
- Overrides:
module
in classReferenceBinding
-
getNestHost
-
setNestHost
-
isNestmateOf
-
getImplicitComponentFields
-
getRecordComponent
- Overrides:
getRecordComponent
in classReferenceBinding
-
getRecordComponentAccessor
Description copied from class:ReferenceBinding
Get the accessor method given the record component name- Overrides:
getRecordComponentAccessor
in classReferenceBinding
- Parameters:
name
- name of the record component- Returns:
- the method binding of the accessor if found, else null
-
computeRecordComponents
public void computeRecordComponents() -
cleanUp
public void cleanUp() -
addField
-
addMethod
-
removeMethod
public void removeMethod(int index) -
rememberTypeHierarchy
public void rememberTypeHierarchy() -
methods
- Overrides:
methods
in classReferenceBinding
-
getMemberType
Description copied from class:ReferenceBinding
Find the member type with the given simple typeName. Benefits from the fact that the array ofReferenceBinding.memberTypes()
is sorted.- Overrides:
getMemberType
in classReferenceBinding
-