public abstract class ReferenceBinding extends TypeBinding
| Modifier and Type | Field and Description |
|---|---|
char[][] |
compoundName |
PackageBinding |
fPackage |
static ReferenceBinding |
LUB_GENERIC |
int |
modifiers |
protected static ProblemMethodBinding |
samProblemBinding |
protected MethodBinding[] |
singleAbstractMethod |
char[] |
sourceName |
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, id, INT, LONG, NULL, SHORT, tagBits, TYPE_USE_BINDING, typeAnnotations, VOIDANY_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_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_PLAIN_PACKAGES, NO_REFERENCE_TYPES, NO_SUPERINTERFACES, NO_TYPE_VARIABLES, NO_TYPES, 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| Constructor and Description |
|---|
ReferenceBinding() |
ReferenceBinding(ReferenceBinding 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."
|
protected void |
appendNullAnnotation(java.lang.StringBuffer nameBuffer,
CompilerOptions options) |
protected int |
applyCloseableClassWhitelists(CompilerOptions options) |
protected int |
applyCloseableInterfaceWhitelists() |
FieldBinding[] |
availableFields()
Return the array of resolvable fields (resilience)
|
MethodBinding[] |
availableMethods()
Return the array of resolvable methods (resilience)
|
static FieldBinding |
binarySearch(char[] name,
FieldBinding[] sortedFields) |
static long |
binarySearch(char[] selector,
MethodBinding[] sortedMethods)
Returns a combined range value representing: (start + (end<<32)), where start is the index of the first matching method
(remember methods are sorted alphabetically on selectors), and end is the index of last contiguous methods with same
selector.
|
boolean |
canBeInstantiated()
Answer true if the receiver can be instantiated
|
boolean |
canBeSeenBy(PackageBinding invocationPackage)
Answer true if the receiver is visible to the invocationPackage.
|
boolean |
canBeSeenBy(ReferenceBinding receiverType,
ReferenceBinding invocationType)
Answer true if the receiver is visible to the receiverType and the invocationType.
|
boolean |
canBeSeenBy(Scope scope)
Answer true if the receiver is visible to the type provided by the scope.
|
char[] |
computeGenericTypeSignature(TypeVariableBinding[] typeVariables) |
void |
computeId() |
void |
computeId(LookupEnvironment environment) |
char[] |
computeUniqueKey(boolean isLeaf)
p.X
|
char[] |
constantPoolName()
Answer the receiver's constant pool name.
|
java.lang.String |
debugName() |
int |
depth() |
boolean |
detectAnnotationCycle() |
ReferenceBinding |
downwardsProjection(Scope scope,
TypeBinding[] mentionedTypeVariables)
Perform a downwards type projection as per JLS 4.10.5
|
ReferenceBinding |
enclosingTypeAt(int relativeDepth) |
int |
enumConstantCount() |
int |
fieldCount() |
FieldBinding[] |
fields() |
int |
getAccessFlags() |
AnnotationBinding[] |
getAnnotations() |
long |
getAnnotationTagBits()
Compute the tagbits for standard annotations.
|
int |
getEnclosingInstancesSlotSize() |
MethodBinding |
getExactConstructor(TypeBinding[] argumentTypes) |
MethodBinding |
getExactMethod(char[] selector,
TypeBinding[] argumentTypes,
CompilationUnitScope refScope) |
FieldBinding |
getField(char[] fieldName,
boolean needResolve) |
FieldBinding |
getField(char[] fieldName,
boolean resolve,
InvocationSite site,
Scope scope)
Where multiple fields with the same name are defined, this will
return the one most visible one...
|
char[] |
getFileName() |
protected MethodBinding[] |
getInterfaceAbstractContracts(Scope scope,
boolean replaceWildcards,
boolean filterDefaultMethods) |
ReferenceBinding |
getMemberType(char[] typeName)
Find the member type with the given simple typeName.
|
MethodBinding[] |
getMethods(char[] selector) |
MethodBinding[] |
getMethods(char[] selector,
int suggestedParameterLength) |
int |
getOuterLocalVariablesSlotSize() |
PackageBinding |
getPackage() |
MethodBinding |
getSingleAbstractMethod(Scope scope,
boolean replaceWildcards)
Return the single abstract method of a functional interface, or one of
null or samProblemBinding, if the receiver is not a functional interface as defined in JLS 9.8. |
TypeVariableBinding |
getTypeVariable(char[] variableName) |
boolean |
hasEnclosingInstanceContext() |
int |
hashCode() |
boolean |
hasHierarchyCheckStarted() |
boolean |
hasIncompatibleSuperType(ReferenceBinding otherType)
Returns true if the two types have an incompatible common supertype,
e.g.
|
boolean |
hasMemberTypes() |
protected boolean |
hasMethodWithNumArgs(char[] selector,
int numArgs) |
boolean |
hasNullBit(int mask)
Query typeBits without triggering supertype lookup.
|
boolean |
hasRestrictedAccess() |
boolean |
implementsInterface(ReferenceBinding anInterface,
boolean searchHierarchy)
Answer true if the receiver implements anInterface or is identical to anInterface.
|
boolean |
innerCanBeSeenBy(ReferenceBinding receiverType,
ReferenceBinding invocationType) |
boolean |
innerCanBeSeenBy(Scope scope) |
boolean |
isAbstract()
Answer true if the receiver is an abstract type
|
boolean |
isAnnotationType() |
boolean |
isBinaryBinding() |
boolean |
isClass() |
boolean |
isCompatibleWith(TypeBinding otherType,
Scope captureScope)
Answer true if the receiver type can be assigned to the argument type (right)
In addition to improving performance, caching also ensures there is no infinite regression
since per nature, the compatibility check is recursive through parameterized type arguments (122775)
|
static boolean |
isConsistentIntersection(TypeBinding[] intersectingTypes) |
boolean |
isDefault()
Answer true if the receiver has default visibility
|
boolean |
isDeprecated()
Answer true if the receiver is a deprecated type
|
boolean |
isEnum() |
boolean |
isFinal()
Answer true if the receiver is final and cannot be subclassed
|
boolean |
isFunctionalInterface(Scope scope) |
boolean |
isHierarchyBeingActivelyConnected()
Returns true if the type hierarchy is being connected "actively" i.e not paused momentatrily,
while resolving type arguments.
|
boolean |
isHierarchyBeingConnected()
Returns true if the type hierarchy is being connected
|
boolean |
isHierarchyConnected()
Returns true if the type hierarchy is connected
|
boolean |
isInterface() |
boolean |
isNestmateOf(ReferenceBinding other) |
boolean |
isOrEnclosedByPrivateType()
Answer true if the receiver or any of its enclosing types have private visibility
|
boolean |
isPrivate()
Answer true if the receiver has private visibility
|
boolean |
isProperType(boolean admitCapture18)
JLS8 Sect 18.1.1
|
boolean |
isProtected()
Answer true if the receiver has protected visibility
|
boolean |
isPublic()
Answer true if the receiver has public visibility
|
boolean |
isStatic()
Answer true if the receiver is a static member type (or toplevel)
|
boolean |
isStrictfp()
Answer true if all float operations must adher to IEEE 754 float/double rules
|
boolean |
isSubtypeOf(TypeBinding other,
boolean simulatingBugJDK8026527) |
protected boolean |
isSubTypeOfRTL(TypeBinding other) |
boolean |
isSuperclassOf(ReferenceBinding otherType)
Answer true if the receiver is in the superclass hierarchy of aType
NOTE: Object.isSuperclassOf(Object) -> false
|
boolean |
isThrowable()
Returns true if a given type may be thrown
|
boolean |
isUncheckedException(boolean includeSupertype)
JLS 11.5 ensures that Throwable, Exception, RuntimeException and Error are directly connected.
|
boolean |
isUsed()
Answer true if the receiver has private visibility and is used locally
|
boolean |
isViewedAsDeprecated()
Answer true if the receiver is deprecated (or any of its enclosing types)
|
ReferenceBinding[] |
memberTypes()
Returns the member types of this type sorted by simple name.
|
MethodBinding[] |
methods() |
ModuleBinding |
module() |
char[] |
nullAnnotatedReadableName(CompilerOptions options,
boolean shortNames)
Answer a readable name (for error reporting) that includes nullness type annotations.
|
ReferenceBinding |
outermostEnclosingType() |
char[] |
qualifiedSourceName()
Answer the source name for the type.
|
char[] |
readableName()
Answer the receiver's signature.
|
char[] |
readableName(boolean showGenerics) |
AnnotationHolder |
retrieveAnnotationHolder(Binding binding,
boolean forceInitialization) |
void |
setAnnotations(AnnotationBinding[] annotations,
boolean forceStore) |
void |
setContainerAnnotationType(ReferenceBinding value) |
void |
setHierarchyCheckDone() |
char[] |
shortReadableName() |
char[] |
shortReadableName(boolean showGenerics) |
char[] |
signature()
Answer the receiver classfile signature.
|
static void |
sortFields(FieldBinding[] sortedFields,
int left,
int right)
Sort the field array using a quicksort
|
static void |
sortMethods(MethodBinding[] sortedMethods,
int left,
int right)
Sort the field array using a quicksort
|
char[] |
sourceName() |
ReferenceBinding |
superclass() |
ReferenceBinding[] |
superInterfaces() |
ReferenceBinding[] |
syntheticEnclosingInstanceTypes() |
void |
tagAsHavingDefectiveContainerType() |
FieldBinding[] |
unResolvedFields() |
ReferenceBinding |
upwardsProjection(Scope scope,
TypeBinding[] mentionedTypeVariables)
Perform an upwards type projection as per JLS 4.10.5
|
actualType, annotatedDebugName, capture, clone, closestMatch, collectMissingTypes, collectSubstitutes, containerAnnotationType, dimensions, enclosingMethod, enclosingType, enterRecursiveFunction, equalsEquals, erasure, exitRecursiveFunction, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, genericTypeSignature, getErasureCompatibleType, getIntersectingTypes, getTypeAnnotations, hasNullTypeAnnotations, hasTypeAnnotations, hasTypeBit, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isBoxedPrimitiveType, isBoxingCompatibleWith, isCapture, isCompatibleWith, isEquivalentTo, isFreeTypeVariable, isFunctionalType, isGenericType, isHierarchyInconsistent, isIntersectionType, isIntersectionType18, isLocalType, isMemberType, isNestedType, isNumericType, isParameterizedType, isParameterizedTypeWithActualArguments, isParameterizedWithOwnVariables, isPolyType, isPotentiallyCompatibleWith, isPrimitiveOrBoxedPrimitiveType, isPrimitiveType, isProvablyDistinct, isRawType, isRecord, isReifiable, isRepeatableAnnotationType, isTypeArgumentContainedBy, isTypeVariable, isUnboundWildcard, isUnresolvedType, isWildcard, kind, leafComponentType, mentionsAny, needsUncheckedConversion, notEquals, original, prototype, qualifiedPackageName, setTypeAnnotations, signableName, sIsMoreSpecific, swapUnresolved, syntheticOuterLocalVariables, typeVariables, unannotated, uncapture, updateTagBits, wellKnownBaseType, wellKnownType, withoutToplevelNullAnnotationcomputeUniqueKey, initializeDeprecatedAnnotationTagBits, isParameter, isTaggedRepeatable, isValid, isValidBinding, isVolatile, problemId, setAnnotationspublic char[][] compoundName
public char[] sourceName
public int modifiers
public PackageBinding fPackage
protected MethodBinding[] singleAbstractMethod
public static final ReferenceBinding LUB_GENERIC
protected static ProblemMethodBinding samProblemBinding
public ReferenceBinding(ReferenceBinding prototype)
public ReferenceBinding()
public static FieldBinding binarySearch(char[] name, FieldBinding[] sortedFields)
public static long binarySearch(char[] selector,
MethodBinding[] sortedMethods)
selector - sortedMethods - public static void sortFields(FieldBinding[] sortedFields, int left, int right)
public static void sortMethods(MethodBinding[] sortedMethods, int left, int right)
public FieldBinding[] availableFields()
public MethodBinding[] availableMethods()
public boolean hasHierarchyCheckStarted()
public void setHierarchyCheckDone()
public boolean canBeInstantiated()
canBeInstantiated in class TypeBindingpublic boolean canBeSeenBy(PackageBinding invocationPackage)
public boolean canBeSeenBy(ReferenceBinding receiverType, ReferenceBinding invocationType)
public final boolean innerCanBeSeenBy(ReferenceBinding receiverType, ReferenceBinding invocationType)
public boolean canBeSeenBy(Scope scope)
canBeSeenBy in class TypeBindingpublic final boolean innerCanBeSeenBy(Scope scope)
public char[] computeGenericTypeSignature(TypeVariableBinding[] typeVariables)
public void computeId()
public void computeId(LookupEnvironment environment)
public char[] computeUniqueKey(boolean isLeaf)
computeUniqueKey in class Bindingpublic char[] constantPoolName()
constantPoolName in class TypeBindingpublic java.lang.String debugName()
debugName in class TypeBindingpublic int depth()
depth in class TypeBindingpublic boolean detectAnnotationCycle()
public final ReferenceBinding enclosingTypeAt(int relativeDepth)
public int enumConstantCount()
public int fieldCount()
public FieldBinding[] fields()
public final int getAccessFlags()
public AnnotationBinding[] getAnnotations()
getAnnotations in class Bindingpublic long getAnnotationTagBits()
BindinggetAnnotationTagBits in class BindingBinding.getAnnotationTagBits()public int getEnclosingInstancesSlotSize()
public MethodBinding getExactConstructor(TypeBinding[] argumentTypes)
public MethodBinding getExactMethod(char[] selector, TypeBinding[] argumentTypes, CompilationUnitScope refScope)
public FieldBinding getField(char[] fieldName, boolean needResolve)
public FieldBinding getField(char[] fieldName, boolean resolve, InvocationSite site, Scope scope)
public char[] getFileName()
IDependent.getFileName()public ReferenceBinding getMemberType(char[] typeName)
memberTypes() is sorted.public MethodBinding[] getMethods(char[] selector)
getMethods in class TypeBindingpublic MethodBinding[] getMethods(char[] selector, int suggestedParameterLength)
public int getOuterLocalVariablesSlotSize()
public PackageBinding getPackage()
getPackage in class TypeBindingpublic TypeVariableBinding getTypeVariable(char[] variableName)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean hasIncompatibleSuperType(ReferenceBinding otherType)
public boolean hasMemberTypes()
public boolean acceptsNonNullDefault()
TypeBindingacceptsNonNullDefault in class TypeBindingpublic final boolean hasRestrictedAccess()
public boolean hasNullBit(int mask)
public boolean implementsInterface(ReferenceBinding anInterface, boolean searchHierarchy)
public final boolean isAbstract()
public boolean isAnnotationType()
isAnnotationType in class Bindingpublic final boolean isBinaryBinding()
public boolean isClass()
isClass in class TypeBindingpublic boolean isNestmateOf(ReferenceBinding other)
public boolean isProperType(boolean admitCapture18)
TypeBindingisProperType in class TypeBindingadmitCapture18 - 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 isCompatibleWith(TypeBinding otherType, Scope captureScope)
isCompatibleWith in class TypeBindingpublic boolean isSubtypeOf(TypeBinding other, boolean simulatingBugJDK8026527)
isSubtypeOf in class TypeBindingprotected boolean isSubTypeOfRTL(TypeBinding other)
public final boolean isDefault()
public final boolean isDeprecated()
public boolean isEnum()
isEnum in class TypeBindingpublic final boolean isFinal()
public boolean isHierarchyBeingConnected()
public boolean isHierarchyBeingActivelyConnected()
public boolean isHierarchyConnected()
public boolean isInterface()
isInterface in class TypeBindingpublic boolean isFunctionalInterface(Scope scope)
isFunctionalInterface in class TypeBindingpublic final boolean isPrivate()
public final boolean isOrEnclosedByPrivateType()
public final boolean isProtected()
public final boolean isPublic()
public final boolean isStatic()
isStatic in class TypeBindingpublic final boolean isStrictfp()
public boolean isSuperclassOf(ReferenceBinding otherType)
public boolean isThrowable()
TypeBindingisThrowable in class TypeBindingTypeBinding.isThrowable()public boolean isUncheckedException(boolean includeSupertype)
isUncheckedException in class TypeBindingTypeBinding.isUncheckedException(boolean)public final boolean isUsed()
public final boolean isViewedAsDeprecated()
public ReferenceBinding[] memberTypes()
public MethodBinding[] methods()
public final ReferenceBinding outermostEnclosingType()
public char[] qualifiedSourceName()
qualifiedSourceName in class TypeBindingpublic char[] readableName()
readableName in class Bindingpublic char[] readableName(boolean showGenerics)
protected void appendNullAnnotation(java.lang.StringBuffer nameBuffer,
CompilerOptions options)
public AnnotationHolder retrieveAnnotationHolder(Binding binding, boolean forceInitialization)
public void setAnnotations(AnnotationBinding[] annotations, boolean forceStore)
setAnnotations in class Bindingpublic void setContainerAnnotationType(ReferenceBinding value)
public void tagAsHavingDefectiveContainerType()
public char[] nullAnnotatedReadableName(CompilerOptions options, boolean shortNames)
TypeBindingnullAnnotatedReadableName in class TypeBindingTypeBinding.nullAnnotatedReadableName(CompilerOptions,boolean)public char[] shortReadableName()
shortReadableName in class Bindingpublic char[] shortReadableName(boolean showGenerics)
public char[] signature()
TypeBindingsignature in class TypeBindingpublic char[] sourceName()
sourceName in class TypeBindingpublic ReferenceBinding upwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables)
upwardsProjection in class TypeBindingscope - Relevant scope for evaluating type projectionmentionedTypeVariables - Filter for mentioned type variabledpublic ReferenceBinding downwardsProjection(Scope scope, TypeBinding[] mentionedTypeVariables)
downwardsProjection in class TypeBindingscope - Relevant scope for evaluating type projectionmentionedTypeVariables - Filter for mentioned type variabledpublic ReferenceBinding superclass()
superclass in class TypeBindingpublic ReferenceBinding[] superInterfaces()
superInterfaces in class TypeBindingpublic ReferenceBinding[] syntheticEnclosingInstanceTypes()
public FieldBinding[] unResolvedFields()
protected int applyCloseableClassWhitelists(CompilerOptions options)
protected boolean hasMethodWithNumArgs(char[] selector,
int numArgs)
protected int applyCloseableInterfaceWhitelists()
protected MethodBinding[] getInterfaceAbstractContracts(Scope scope, boolean replaceWildcards, boolean filterDefaultMethods) throws InvalidInputException
InvalidInputExceptionpublic MethodBinding getSingleAbstractMethod(Scope scope, boolean replaceWildcards)
TypeBindingnull or samProblemBinding, if the receiver is not a functional interface as defined in JLS 9.8.
In particular null is answered if the receiver is not a reference type, or is a problem type.getSingleAbstractMethod in class TypeBindingscope - scopereplaceWildcards - Should wildcards be replaced following JLS 9.8? Say false for lambdas with explicit argument types which should apply 18.5.3null or samProblemBinding, if the receiver is not a functional interface.public static boolean isConsistentIntersection(TypeBinding[] intersectingTypes)
public ModuleBinding module()
public boolean hasEnclosingInstanceContext()