org.aspectj.weaver
Class BoundedReferenceType

java.lang.Object
  extended by org.aspectj.weaver.UnresolvedType
      extended by org.aspectj.weaver.ResolvedType
          extended by org.aspectj.weaver.ReferenceType
              extended by org.aspectj.weaver.BoundedReferenceType
All Implemented Interfaces:
AnnotatedElement, Traceable, TypeVariableDeclaringElement

public class BoundedReferenceType
extends ReferenceType

A BoundedReferenceType is the result of a generics wildcard expression ? extends String, ? super Foo etc.. The "signature" for a bounded reference type follows the generic signature specification in section 4.4 of JVM spec: *,+,- plus signature strings. The bound may be a type variable (e.g. ? super T)


Nested Class Summary
 
Nested classes/interfaces inherited from class org.aspectj.weaver.UnresolvedType
UnresolvedType.TypeKind
 
Field Summary
protected  ReferenceType[] additionalInterfaceBounds
           
static int EXTENDS
           
 int kind
           
static int SUPER
           
static int UNBOUND
           
 
Fields inherited from class org.aspectj.weaver.ReferenceType
EMPTY_ARRAY
 
Fields inherited from class org.aspectj.weaver.ResolvedType
crosscuttingMembers, EMPTY_RESOLVED_TYPE_ARRAY, interTypeMungers, MISSING, NONE, PARAMETERIZED_TYPE_IDENTIFIER, temporaryAnnotationTypes, validBoxing, world
 
Fields inherited from class org.aspectj.weaver.UnresolvedType
ANNOTATION, ARRAY_WITH_JUST_OBJECT, AT_INHERITED, AT_RETENTION, AT_TARGET, BOOLEAN, BYTE, CHAR, CLONEABLE, DOUBLE, ENUM, ERROR, FLOAT, INT, JAVA_LANG_ANNOTATION, JAVA_LANG_CLASS_ARRAY, JAVA_LANG_REFLECT_CONSTRUCTOR, JAVA_LANG_REFLECT_FIELD, JAVA_LANG_REFLECT_METHOD, JL_CLASS, JL_EXCEPTION, JL_STRING, JOINPOINT_ENCLOSINGSTATICPART, JOINPOINT_STATICPART, LONG, MISSING_NAME, OBJECT, OBJECTARRAY, RUNTIME_EXCEPTION, SERIALIZABLE, SHORT, signature, signatureErasure, SOMETHING, SUPPRESS_AJ_WARNINGS, THROWABLE, typeKind, typeParameters, typeVariables, VOID
 
Constructor Summary
  BoundedReferenceType(ReferenceType aBound, boolean isExtends, World world)
           
  BoundedReferenceType(ReferenceType aBound, boolean isExtends, World world, ReferenceType[] additionalInterfaces)
           
protected BoundedReferenceType(java.lang.String signature, java.lang.String erasedSignature, World world)
          only for use when resolving GenericsWildcardTypeX or a TypeVariableReferenceType
  BoundedReferenceType(World world)
          Constructs the BoundedReferenceType representing an unbounded wildcard '?'.
 
Method Summary
 boolean alwaysMatches(ResolvedType aCandidateType)
           
 boolean canBeCoercedTo(ResolvedType aCandidateType)
           
 ReferenceType[] getAdditionalBounds()
           
 ResolvedType[] getDeclaredInterfaces()
          Find out from the generic signature the true signature of any interfaces I implement.
 UnresolvedType getLowerBound()
           
 java.lang.String getSimpleName()
           
 UnresolvedType getUpperBound()
           
 boolean hasLowerBound()
           
 boolean isExtends()
           
 boolean isGenericWildcard()
           
 boolean isSuper()
           
 boolean isUnbound()
           
 UnresolvedType parameterize(java.util.Map<java.lang.String,UnresolvedType> typeBindings)
          Iff I am a parameterized type, and any of my parameters are type variable references (or nested parameterized types), return a version with those type parameters replaced in accordance with the passed bindings.
 
Methods inherited from class org.aspectj.weaver.ReferenceType
addAnnotation, addParent, canAnnotationTargetType, checkDuplicates, demoteToSimpleType, doesNotExposeShadowMungers, ensureConsistent, findDerivativeType, fromTypeX, getAnnotationOfType, getAnnotations, getAnnotationTargetKinds, getAnnotationTypes, getCompilerVersion, getDeclaredFields, getDeclaredGenericSignature, getDeclaredMethods, getDeclaredPointcuts, getDeclares, getDelegate, getEndPos, getGenericSignature, getGenericType, getModifiers, getNameAsIdentifier, getOuterClass, getPerClause, getPrivilegedAccesses, getRetentionPolicy, getSignatureForAttribute, getSourceContext, getSourceLocation, getStartPos, getSuperclass, getTypeMungers, getTypeVariables, getWeaverState, hasAnnotation, hasNewInterfaces, isAnnotation, isAnnotationStyleAspect, isAnnotationWithRuntimeRetention, isAnonymous, isAspect, isAssignableFrom, isAssignableFrom, isClass, isCoerceableFrom, isEnum, isExposedToWeaver, isGenericType, isNested, setDelegate, setEndPos, setGenericType, setStartPos
 
Methods inherited from class org.aspectj.weaver.ResolvedType
addInterTypeMunger, ajMembersNeedParameterization, checkInterTypeMungers, checkLegalOverride, clearInterTypeMungers, collectCrosscuttingMembers, collectDeclares, collectInterTypeMungers, conflictingSignature, discoverActualOccurrenceOfTypeInHierarchy, equals, fillInAnyTypeParameters, findPointcut, getAjMemberParameterizationMap, getBinaryPath, getDeclaredAdvice, getDeclaredJavaFields, getDeclaredJavaMethods, getDeclaredShadowMungers, getDeclaringType, getDirectSupertypes, getExposedPointcuts, getFields, getHierarchy, getHierarchy, getHierarchyWithoutIterator, getInterTypeMungers, getInterTypeMungersIncludingSupers, getInterTypeParentMungers, getInterTypeParentMungersIncludingSupers, getMemberParameterizationMap, getMethods, getMethodsIncludingIntertypeDeclarations, getMethodsWithoutIterator, getPointcuts, getRawType, getResolvedComponentType, getResolvedTypeParameters, getSize, getTopmostImplementor, getWorld, isAbstract, isCacheable, isCheckedException, isConvertableFrom, isException, isFinal, isGroovyObject, isInheritedAnnotation, isInterface, isMissing, isMissing, isMoreVisible, isParameterizedWithTypeVariable, isPrimitiveArray, isSynthetic, isTopmostImplementor, isTypeHierarchyComplete, isVisible, lookupDirectlyDeclaredMemberNoSupers, lookupField, lookupMemberIncludingITDsOnInterfaces, lookupMemberNoSupers, lookupMemberWithSupersAndITDs, lookupMethod, lookupMethodInITDs, lookupResolvedMember, lookupSyntheticMember, makeArray, matches, needsNoConversionFrom, parameterizedWith, setBinaryPath, tagAsTypeHierarchyComplete
 
Methods inherited from class org.aspectj.weaver.UnresolvedType
add, forGenericType, forGenericTypeSignature, forGenericTypeVariables, forName, forNames, forPrimitiveType, forRawTypeName, forSignature, forSignatures, getBaseName, getClassName, getComponentType, getErasureSignature, getName, getNames, getOutermostType, getPackageName, getPackageNameAsIdentifier, getRawName, getSignature, getSimpleBaseName, getTypekind, getTypeParameters, getTypeVariableNamed, hashCode, insert, isArray, isParameterizedOrGenericType, isParameterizedOrRawType, isParameterizedType, isPrimitiveType, isRawType, isSimpleType, isTypeVariableReference, isVoid, makeArray, needsModifiableDelegate, read, readArray, resolve, setNeedsModifiableDelegate, toDebugString, toString, toTraceString, write, writeArray
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNBOUND

public static final int UNBOUND
See Also:
Constant Field Values

EXTENDS

public static final int EXTENDS
See Also:
Constant Field Values

SUPER

public static final int SUPER
See Also:
Constant Field Values

kind

public int kind

additionalInterfaceBounds

protected ReferenceType[] additionalInterfaceBounds
Constructor Detail

BoundedReferenceType

public BoundedReferenceType(ReferenceType aBound,
                            boolean isExtends,
                            World world)

BoundedReferenceType

public BoundedReferenceType(ReferenceType aBound,
                            boolean isExtends,
                            World world,
                            ReferenceType[] additionalInterfaces)

BoundedReferenceType

protected BoundedReferenceType(java.lang.String signature,
                               java.lang.String erasedSignature,
                               World world)
only for use when resolving GenericsWildcardTypeX or a TypeVariableReferenceType


BoundedReferenceType

public BoundedReferenceType(World world)
Constructs the BoundedReferenceType representing an unbounded wildcard '?'. In this situation the signature is '*' and the erased signature is Ljava/lang/Object;

Method Detail

getUpperBound

public UnresolvedType getUpperBound()

getLowerBound

public UnresolvedType getLowerBound()

getAdditionalBounds

public ReferenceType[] getAdditionalBounds()

parameterize

public UnresolvedType parameterize(java.util.Map<java.lang.String,UnresolvedType> typeBindings)
Description copied from class: ResolvedType
Iff I am a parameterized type, and any of my parameters are type variable references (or nested parameterized types), return a version with those type parameters replaced in accordance with the passed bindings.

Overrides:
parameterize in class ResolvedType

hasLowerBound

public boolean hasLowerBound()

isExtends

public boolean isExtends()

isSuper

public boolean isSuper()

isUnbound

public boolean isUnbound()

alwaysMatches

public boolean alwaysMatches(ResolvedType aCandidateType)

canBeCoercedTo

public boolean canBeCoercedTo(ResolvedType aCandidateType)

getSimpleName

public java.lang.String getSimpleName()
Overrides:
getSimpleName in class UnresolvedType

getDeclaredInterfaces

public ResolvedType[] getDeclaredInterfaces()
Description copied from class: ReferenceType
Find out from the generic signature the true signature of any interfaces I implement. If I am parameterized, these may then need to be parameterized before returning.

Overrides:
getDeclaredInterfaces in class ReferenceType

isGenericWildcard

public boolean isGenericWildcard()
Overrides:
isGenericWildcard in class UnresolvedType