org.aspectj.org.eclipse.jdt.internal.compiler.lookup
Class WildcardBinding

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
      extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
          extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
              extended by org.aspectj.org.eclipse.jdt.internal.compiler.lookup.WildcardBinding

public class WildcardBinding
extends ReferenceBinding


Field Summary
 TypeBinding bound
           
 int boundKind
           
 ReferenceBinding genericType
           
 TypeBinding[] otherBounds
           
 int rank
           
 
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, 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, DefaultLocationTypeArgument, DefaultLocationTypeBound, DefaultLocationTypeParameter, FIELD, GENERIC_TYPE, IMPORT, INTERSECTION_CAST_TYPE, INTERSECTION_TYPE, 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
 
Constructor Summary
WildcardBinding(ReferenceBinding genericType, int rank, TypeBinding bound, TypeBinding[] otherBounds, int boundKind, LookupEnvironment environment)
          When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound lazily)
 
Method Summary
 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."
 ReferenceBinding actualType()
           
 TypeBinding allBounds()
           
 java.lang.String annotatedDebugName()
           
 boolean boundCheck(TypeBinding argumentType)
          Returns true if the argument type satisfies the wildcard bound(s)
 boolean canBeInstantiated()
          Answer true if the receiver can be instantiated
 TypeBinding 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.
 java.util.List collectMissingTypes(java.util.List missingTypes)
          Iterate through the type components to collect instances of leaf missing types
 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.
 char[] computeUniqueKey(boolean isLeaf)
          p.X {} -> Lp/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 exitRecursiveFunction()
          Exit the context of a potentially recursive function.
 char[] genericTypeSignature()
          Answer the receiver classfile signature.
 ReferenceBinding[] getIntersectingTypes()
           
 int hashCode()
           
 boolean hasTypeBit(int bit)
          Answer an additional bit characterizing this type, like TypeIds.BitAutoCloseable.
 boolean isHierarchyConnected()
          Returns true if the type hierarchy is connected
 boolean isIntersectionType()
          Returns true if the current type denotes an intersection type: Number & Comparable
 boolean isProperType(boolean admitCapture18)
          JLS8 Sect 18.1.1
 boolean isSuperclassOf(ReferenceBinding otherType)
          Answer true if the receiver is in the superclass hierarchy of aType NOTE: Object.isSuperclassOf(Object) -> false
 boolean isUnboundWildcard()
          Returns true if the type is a wildcard
 boolean isWildcard()
          Returns true if the type is a wildcard
 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.
 char[] readableName()
          Answer the receiver's signature.
 char[] shortReadableName()
           
 char[] signature()
          Answer the receiver classfile signature.
 char[] sourceName()
           
 ReferenceBinding superclass()
           
 ReferenceBinding[] superInterfaces()
           
 void swapUnresolved(UnresolvedReferenceBinding unresolvedType, ReferenceBinding resolvedType, LookupEnvironment env)
           
 java.lang.String toString()
           
 TypeVariableBinding typeVariable()
          Returns associated type variable, or null in case of inconsistency
 TypeBinding unannotated(boolean removeOnlyNullAnnotations)
          Return this type minus its type annotations
 TypeBinding uncapture(Scope scope)
          Perform capture "deconversion" on a given type
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding
appendNullAnnotation, applyCloseableClassWhitelists, applyCloseableInterfaceWhitelists, availableFields, availableMethods, binarySearch, binarySearch, canBeSeenBy, canBeSeenBy, canBeSeenBy, computeGenericTypeSignature, computeId, depth, detectAnnotationCycle, enclosingTypeAt, enumConstantCount, fieldCount, fields, getAccessFlags, getAnnotations, getAnnotationTagBits, getEnclosingInstancesSlotSize, getExactConstructor, getExactMethod, getField, getField, getFileName, getMemberType, getMethods, getMethods, getOuterLocalVariablesSlotSize, getPackage, getSingleAbstractMethod, getTypeVariable, 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, isSubtypeOf, isSubTypeOfRTL, isThrowable, isUncheckedException, isUsed, isViewedAsDeprecated, memberTypes, methods, outermostEnclosingType, qualifiedSourceName, retrieveAnnotationHolder, setAnnotations, setContainerAnnotationType, sortFields, sortMethods, syntheticEnclosingInstanceTypes, tagAsHavingDefectiveContainerType, unResolvedFields
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.TypeBinding
capture, closestMatch, containerAnnotationType, dimensions, enclosingType, equalsEquals, findSuperTypeOriginatingFrom, findSuperTypeOriginatingFrom, genericCast, getErasureCompatibleType, getTypeAnnotations, hasNullTypeAnnotations, hasTypeAnnotations, isAnonymousType, isArrayType, isBaseType, isBoundParameterizedType, isBoxedPrimitiveType, isCapture, isCompatibleWith, isEquivalentTo, isGenericType, isHierarchyInconsistent, isIntersectionCastType, isLocalType, isMemberType, isNestedType, isNumericType, isParameterizedType, isParameterizedTypeWithActualArguments, isParameterizedWithOwnVariables, isPrimitiveOrBoxedPrimitiveType, isPrimitiveType, isProvablyDistinct, isRawType, isReifiable, isRepeatableAnnotationType, isTypeArgumentContainedBy, isTypeVariable, isUnresolvedType, leafComponentType, needsUncheckedConversion, notEquals, original, prototype, qualifiedPackageName, setTypeAnnotations, sIsMoreSpecific, syntheticOuterLocalVariables, typeVariables, wellKnownType
 
Methods inherited from class org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding
computeUniqueKey, initializeDeprecatedAnnotationTagBits, isParameter, isTaggedRepeatable, isValidBinding, isVolatile, problemId, setAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

genericType

public ReferenceBinding genericType

rank

public int rank

bound

public TypeBinding bound

otherBounds

public TypeBinding[] otherBounds

boundKind

public int boundKind
Constructor Detail

WildcardBinding

public WildcardBinding(ReferenceBinding genericType,
                       int rank,
                       TypeBinding bound,
                       TypeBinding[] otherBounds,
                       int boundKind,
                       LookupEnvironment environment)
When unbound, the bound denotes the corresponding type variable (so as to retrieve its bound lazily)

Method Detail

allBounds

public TypeBinding allBounds()

actualType

public ReferenceBinding actualType()
Overrides:
actualType in class TypeBinding

kind

public int kind()
Overrides:
kind in class TypeBinding

boundCheck

public boolean boundCheck(TypeBinding argumentType)
Returns true if the argument type satisfies the wildcard bound(s)


canBeInstantiated

public boolean canBeInstantiated()
Description copied from class: ReferenceBinding
Answer true if the receiver can be instantiated

Overrides:
canBeInstantiated in class ReferenceBinding
See Also:
ReferenceBinding.canBeInstantiated()

collectMissingTypes

public java.util.List collectMissingTypes(java.util.List missingTypes)
Description copied from class: TypeBinding
Iterate through the type components to collect instances of leaf missing types

Overrides:
collectMissingTypes in class TypeBinding
Returns:
missing types
See Also:
TypeBinding.collectMissingTypes(java.util.List)

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 class TypeBinding

computeUniqueKey

public char[] computeUniqueKey(boolean isLeaf)
Description copied from class: ReferenceBinding
p.X {} -> Lp/X;

Overrides:
computeUniqueKey in class ReferenceBinding

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 class ReferenceBinding
See Also:
TypeBinding.constantPoolName()

clone

public TypeBinding clone(TypeBinding immaterial)
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 class TypeBinding

annotatedDebugName

public java.lang.String annotatedDebugName()
Overrides:
annotatedDebugName in class TypeBinding

debugName

public java.lang.String debugName()
Overrides:
debugName in class ReferenceBinding
See Also:
TypeBinding.debugName()

erasure

public TypeBinding erasure()
Overrides:
erasure in class TypeBinding

genericTypeSignature

public char[] genericTypeSignature()
Description copied from class: TypeBinding
Answer the receiver classfile signature. Arrays & base types do not distinguish between signature() & constantPoolName(). NOTE: This method should only be used during/after code gen.

Overrides:
genericTypeSignature in class TypeBinding

hashCode

public int hashCode()
Overrides:
hashCode in class ReferenceBinding

hasTypeBit

public boolean hasTypeBit(int bit)
Description copied from class: TypeBinding
Answer an additional bit characterizing this type, like TypeIds.BitAutoCloseable.

Overrides:
hasTypeBit in class TypeBinding

isSuperclassOf

public boolean isSuperclassOf(ReferenceBinding otherType)
Description copied from class: ReferenceBinding
Answer true if the receiver is in the superclass hierarchy of aType NOTE: Object.isSuperclassOf(Object) -> false

Overrides:
isSuperclassOf in class ReferenceBinding
See Also:
ReferenceBinding.isSuperclassOf(org.aspectj.org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding)

isIntersectionType

public boolean isIntersectionType()
Returns true if the current type denotes an intersection type: Number & Comparable

Overrides:
isIntersectionType in class TypeBinding

getIntersectingTypes

public ReferenceBinding[] getIntersectingTypes()
Overrides:
getIntersectingTypes in class TypeBinding

isHierarchyConnected

public boolean isHierarchyConnected()
Description copied from class: ReferenceBinding
Returns true if the type hierarchy is connected

Overrides:
isHierarchyConnected in class ReferenceBinding

enterRecursiveFunction

public boolean enterRecursiveFunction()
Description copied from class: TypeBinding
Call this before descending into type details to prevent infinite recursion.

Overrides:
enterRecursiveFunction in class TypeBinding
Returns:
true if a recursion has already been started.

exitRecursiveFunction

public void exitRecursiveFunction()
Description copied from class: TypeBinding
Exit the context of a potentially recursive function.

Overrides:
exitRecursiveFunction in class TypeBinding

isProperType

public boolean isProperType(boolean admitCapture18)
Description copied from class: TypeBinding
JLS8 Sect 18.1.1

Overrides:
isProperType in class ReferenceBinding
Parameters:
admitCapture18 - 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.

isUnboundWildcard

public boolean isUnboundWildcard()
Returns true if the type is a wildcard

Overrides:
isUnboundWildcard in class TypeBinding

isWildcard

public boolean isWildcard()
Returns true if the type is a wildcard

Overrides:
isWildcard in class TypeBinding

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 class ReferenceBinding

nullAnnotatedReadableName

public char[] nullAnnotatedReadableName(CompilerOptions options,
                                        boolean shortNames)
Description copied from class: TypeBinding
Answer a readable name (for error reporting) that includes nullness type annotations.

Overrides:
nullAnnotatedReadableName in class ReferenceBinding
See Also:
TypeBinding.nullAnnotatedReadableName(CompilerOptions,boolean)

shortReadableName

public char[] shortReadableName()
Overrides:
shortReadableName in class ReferenceBinding

signature

public char[] signature()
Description copied from class: TypeBinding
Answer the receiver classfile signature. Arrays & base types do not distinguish between signature() & constantPoolName(). NOTE: This method should only be used during/after code gen.

Overrides:
signature in class ReferenceBinding
See Also:
TypeBinding.signature()

sourceName

public char[] sourceName()
Overrides:
sourceName in class ReferenceBinding

superclass

public ReferenceBinding superclass()
Overrides:
superclass in class ReferenceBinding

superInterfaces

public ReferenceBinding[] superInterfaces()
Overrides:
superInterfaces in class ReferenceBinding

swapUnresolved

public void swapUnresolved(UnresolvedReferenceBinding unresolvedType,
                           ReferenceBinding resolvedType,
                           LookupEnvironment env)
Overrides:
swapUnresolved in class TypeBinding

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

typeVariable

public TypeVariableBinding typeVariable()
Returns associated type variable, or null in case of inconsistency


unannotated

public TypeBinding unannotated(boolean removeOnlyNullAnnotations)
Description copied from class: TypeBinding
Return this type minus its type annotations

Overrides:
unannotated in class TypeBinding
Parameters:
removeOnlyNullAnnotations - if true only null type annotations are removed, otherwise all type annotations.

uncapture

public TypeBinding uncapture(Scope scope)
Description copied from class: TypeBinding
Perform capture "deconversion" on a given type

Overrides:
uncapture in class TypeBinding

mentionsAny

public boolean mentionsAny(TypeBinding[] parameters,
                           int idx)
Description copied from class: TypeBinding
Does this type mention any of the given type parameters, except the one at position 'idx'?

Overrides:
mentionsAny in class TypeBinding

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 class ReferenceBinding