Class TypeVariableReferenceType
java.lang.Object
org.aspectj.weaver.UnresolvedType
org.aspectj.weaver.ResolvedType
org.aspectj.weaver.ReferenceType
org.aspectj.weaver.TypeVariableReferenceType
- All Implemented Interfaces:
AnnotatedElement, Traceable, TypeVariableDeclaringElement, TypeVariableReference
ReferenceType pointing to a type variable. The delegate for this reference type is the upperbound on the type variable (so
Object if not otherwise specified).
- Author:
- Adrian Colyer, Andy Clement
-
Nested Class Summary
Nested classes/interfaces inherited from class UnresolvedType
UnresolvedType.TypeKind -
Field Summary
Fields inherited from class ReferenceType
EMPTY_ARRAYFields inherited from class ResolvedType
bits, crosscuttingMembers, EMPTY_RESOLVED_TYPE_ARRAY, interTypeMungers, MISSING, NONE, PARAMETERIZED_TYPE_IDENTIFIER, temporaryAnnotationTypes, validBoxing, worldModifier and TypeFieldDescriptionprotected intstatic final ResolvedType[]protected List<ConcreteTypeMunger> static final org.aspectj.weaver.ResolvedType.Missingstatic final ResolvedType[]static final Stringprotected WorldFields inherited from class UnresolvedType
AJC_PRIVILEGED, 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, PROCEEDING_JOINPOINT, RUNTIME_EXCEPTION, SERIALIZABLE, SHORT, signature, signatureErasure, SOMETHING, SUPPRESS_AJ_WARNINGS, THROWABLE, typeKind, typeParameters, typeVariables, VOIDModifier and TypeFieldDescriptionstatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedType[]static final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final Stringstatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypeprotected Stringprotected StringThe erasure of the signature.static final UnresolvedTypestatic final UnresolvedTypestatic final UnresolvedTypeprotected UnresolvedType.TypeKindprotected UnresolvedType[]Iff isParameterized(), then these are the type parametersprotected TypeVariable[]Iff isGeneric(), then these are the type variables declared on the type Iff isParameterized(), then these are the type variables bound as parameters in the typestatic final UnresolvedType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquality is checked based on the underlying signature.For a TypeVariableReferenceType the delegate is the delegate for the first bound.return the signature for a *REFERENCE* to a type variable, which is simply: Tname; there is no bounds info included, that is in the signature of the type variable itselfinthashCode()Equality is checked based on the underlying signature, so the hash code of a particular type is the hash code of its signature string.booleanNote: Only overridden by Name subtype.booleanbooleanbooleanparameterize(Map<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.resolve the type variable we are managing and then return this object.toString()Returns a java language string representation of this type.Methods inherited from class ReferenceType
addAnnotation, addParent, canAnnotationTargetType, checkDuplicates, demoteToSimpleType, doesNotExposeShadowMungers, ensureConsistent, findDerivativeType, fromTypeX, getAnnotationOfType, getAnnotations, getAnnotationTargetKinds, getAnnotationTypes, getCompilerVersion, getDeclaredFields, getDeclaredGenericSignature, getDeclaredInterfaces, getDeclaredMethods, getDeclaredPointcuts, getDeclares, getEndPos, getGenericSignature, getGenericType, getModifiers, getNameAsIdentifier, getOuterClass, getPerClause, getPrivilegedAccesses, getRetentionPolicy, getSignatureForAttribute, getSourceContext, getSourceLocation, getStartPos, getSuperclass, getTypeMungers, getTypeVariables, getWeaverState, hasAnnotation, hasAnnotations, hasNewInterfaces, isAnnotationStyleAspect, isAnnotationWithRuntimeRetention, isAnonymous, isAspect, isAssignableFrom, isAssignableFrom, isClass, isCoerceableFrom, isEnum, isExposedToWeaver, isGenericType, isNested, setDelegate, setEndPos, setGenericType, setStartPosModifier and TypeMethodDescriptionvoidaddAnnotation(AnnotationAJ annotationX) voidaddParent(ResolvedType newParent) booleanNote: Only overridden by ReferenceType subtypevoidcheckDuplicates(ReferenceType newRt) voidbooleanvoidUndo any temporary modifications to the type (for example it may be holding annotations temporarily whilst some matching is occurring - These annotations will be added properly during weaving but sometimes for type completion they need to be held here for a while).findDerivativeType(ResolvedType[] typeParameters) Look for a derivative type with the specified type parameters.static ReferenceTypefromTypeX(UnresolvedType tx, World world) getAnnotationOfType(UnresolvedType ofType) Note: Only overridden by ReferenceType subtypeintreturn the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.Find out from the generic signature the true signature of any interfaces I implement.intOverridden by ReferenceType to return a sensible answer for parameterized and raw types.intintbooleanhasAnnotation(UnresolvedType ofType) booleanbooleanbooleanbooleanNote: Only overridden by Name subtype.booleanbooleanisAspect()booleanisAssignableFrom(ResolvedType other) Determines if the variables of this type could be assigned values of another type without casting.booleanisAssignableFrom(ResolvedType other, boolean allowMissing) booleanisClass()booleanDetermines if values of another type could possibly be cast to this type.booleanisEnum()Note: Only overridden by Name subtype.booleanbooleanbooleanisNested()voidsetDelegate(ReferenceTypeDelegate delegate) voidsetEndPos(int endPos) voidvoidsetStartPos(int startPos) Methods inherited from class ResolvedType
addInterTypeMunger, ajMembersNeedParameterization, canBeSeenBy, checkInterTypeMungers, checkLegalOverride, clearInterTypeMungers, collectCrosscuttingMembers, collectDeclares, collectInterTypeMungers, conflictingSignature, conflictingSignature, discoverActualOccurrenceOfTypeInHierarchy, 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, isPrivilegedAspect, isSynthetic, isTopmostImplementor, isTypeHierarchyComplete, isVisible, lookupDirectlyDeclaredMemberNoSupers, lookupField, lookupMemberIncludingITDsOnInterfaces, lookupMemberNoSupers, lookupMemberWithSupersAndITDs, lookupMethod, lookupMethodInITDs, lookupResolvedMember, lookupSyntheticMember, makeArray, matches, needsNoConversionFrom, parameterizedWith, setBinaryPath, tagAsTypeHierarchyCompleteModifier and TypeMethodDescriptionvoidaddInterTypeMunger(ConcreteTypeMunger munger, boolean isDuringCompilation) Add an intertype munger to this type.protected booleanbooleancanBeSeenBy(ResolvedType from) voidCheck: 1) That we don't have any abstract type mungers unless this type is abstract.booleancheckLegalOverride(ResolvedMember parent, ResolvedMember child, int transformerPosition, ResolvedType aspectType) voidcollectCrosscuttingMembers(boolean shouldConcretizeIfNeeded) collectDeclares(boolean includeAdviceLike) protected voidcollectInterTypeMungers(List<ConcreteTypeMunger> collector) static booleanconflictingSignature(Member m1, Member m2) static booleanconflictingSignature(Member m1, Member m2, boolean v2itds) Do the two members conflict? Due to the change in 1.7.1, field itds on interfaces now act like 'default' fields - so types implementing those fields get the field if they don't have it already, otherwise they keep what they have.Look up the actual occurence of a particular type in the hierarchy for 'this' type.Called for all type mungers but only does something if they share type variables with a generic type which they target.findPointcut(String name) protected Map<String, UnresolvedType> Returns the path to the jar or class file from which this binary aspect came or null if not a binary aspectReturns a ResolvedType object representing the declaring type of this type, or null if this type does not represent a non-package-level-type.final Iterator<ResolvedType> Returns an iterator through ResolvedType objects representing all the direct supertypes of this type.returns an iterator through all of the fields of this type, in order for checking from JVM spec 2ed 5.4.3.2.Return an iterator over the types in this types hierarchy - starting with this type first, then all superclasses up to Object and then all interfaces (starting with those 'nearest' this type).getHierarchy(boolean wantGenerics, boolean wantDeclaredParents) Return an iterator over the types in this types hierarchy - starting with this type first, then all superclasses up to Object and then all interfaces (starting with those 'nearest' this type).getHierarchyWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) Return a list of the types in the hierarchy of this type, starting with this type.??? This method is O(N*M) where N = number of methods and M is number of inter-type declarations in my superprotected Map<String, UnresolvedType> getMethods(boolean wantGenerics, boolean wantDeclaredParents) returns an iterator through all of the methods of this type, in order for checking from JVM spec 2ed 5.4.3.3.getMethodsIncludingIntertypeDeclarations(boolean wantGenerics, boolean wantDeclaredParents) getMethodsWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware) Return a list of methods, first those declared on this class, then those declared on the superclass (recurse) and then those declared on the superinterfaces.returns an iterator through all of the pointcuts of this type, in order for checking from JVM spec 2ed 5.4.3.2 (as for fields).intgetSize()This is the size of this type as used in JVM.getTopmostImplementor(ResolvedType interfaceType) getWorld()final booleanbooleanbooleanfinal booleanisConvertableFrom(ResolvedType other) Determines if variables of this type could be assigned values of another with lots of help.booleanfinal booleanisFinal()booleanbooleanFor an annotation type, this will return if it is marked with @Inheritedfinal booleanbooleanstatic booleanisMissing(UnresolvedType unresolved) static booleanisMoreVisible(int m1, int m2) booleanreturn true if the parameterization of this type includes a member type variable.booleanbooleanbooleanbooleanisTopmostImplementor(ResolvedType interfaceType) booleanstatic booleanisVisible(int modifiers, ResolvedType targetType, ResolvedType fromType) as lookupMemberNoSupers, but does not include ITDslookupField(Member field) described in JVM spec 2ed 5.4.3.2This lookup has specialized behaviour - a null result tells the EclipseTypeMunger that it should make a default implementation of a method on this type.lookupMemberNoSupers(Member member) Look up a member, takes into account any ITDs on this type.lookupMemberWithSupersAndITDs(Member member) described in JVM spec 2ed 5.4.3.3.lookupMethodInITDs(Member member) lookupResolvedMember(ResolvedMember aMember, boolean allowMissing, boolean eraseGenerics) Looks for the first member in the hierarchy matching aMember.lookupSyntheticMember(Member member) static ResolvedTypemakeArray(ResolvedType type, int dim) static booleanbooleanparameterizedWith(UnresolvedType[] typeParameters) voidsetBinaryPath(String binaryPath) voidMethods inherited from class UnresolvedType
add, forGenericType, forGenericTypeSignature, forGenericTypeVariables, forName, forNames, forPrimitiveType, forRawTypeName, forSignature, forSignatures, getBaseName, getClassName, getComponentType, getDimensions, getErasureSignature, getName, getNames, getOutermostType, getPackageName, getPackageNameAsIdentifier, getRawName, getSimpleBaseName, getSimpleName, getTypekind, getTypeParameters, getTypeVariableNamed, insert, isArray, isParameterizedOrGenericType, isParameterizedOrRawType, isParameterizedType, isPrimitiveType, isRawType, isSimpleType, isVoid, makeArray, needsModifiableDelegate, read, readArray, setNeedsModifiableDelegate, toDebugString, toTraceString, write, writeArrayModifier and TypeMethodDescriptionstatic UnresolvedType[]add(UnresolvedType[] types, UnresolvedType end) Creates a new type array with a fresh type appended to the end.static UnresolvedTypeforGenericType(String name, TypeVariable[] tvbs, String genericSig) static UnresolvedTypeforGenericTypeSignature(String sig, String declaredGenericSig) static UnresolvedTypeforGenericTypeVariables(String sig, TypeVariable[] tVars) static UnresolvedTypeNOTE: Use forSignature() if you can, it'll be cheaper ! Constructs a UnresolvedType for a java language type name.static UnresolvedType[]Constructs a UnresolvedType for each java language type name in an incoming array.static UnresolvedTypeforPrimitiveType(String signature) static UnresolvedTypeforRawTypeName(String name) static UnresolvedTypeforSignature(String signature) Constructs a Type for a JVM bytecode signature string.static UnresolvedType[]forSignatures(String[] sigs) Constructs a UnresolvedType for each JVM bytecode type signature in an incoming array.Returns a UnresolvedType object representing the component type of this array, or null if this type does not represent an array type.final intFor parameterized types, return the signature for the raw typegetName()Returns the name of this type in java language form (e.g.static String[]getNames(UnresolvedType[] types) Returns an array of strings representing the java langauge names of an array of types.Returns a UnresolvedType object representing the effective outermost enclosing type for a name type.getTypeVariableNamed(String name) static UnresolvedType[]insert(UnresolvedType start, UnresolvedType[] types) Creates a new type array with a fresh type inserted at the beginning.final booleanisArray()booleanbooleanbooleanbooleanbooleanbooleanbooleanisVoid()static UnresolvedTypemakeArray(UnresolvedType base, int dims) booleanstatic UnresolvedTypeRead in an UnresolvedType - just read the signature and rebuild the UnresolvedType.static UnresolvedType[]voidsetNeedsModifiableDelegate(boolean b) final voidWrite out an UnresolvedType - the signature should be enough.static voidwriteArray(UnresolvedType[] types, CompressingDataOutputStream stream)
-
Constructor Details
-
TypeVariableReferenceType
-
-
Method Details
-
equals
Description copied from class:UnresolvedTypeEquality is checked based on the underlying signature.- Overrides:
equalsin classResolvedType
-
hashCode
public int hashCode()Description copied from class:UnresolvedTypeEquality is checked based on the underlying signature, so the hash code of a particular type is the hash code of its signature string.- Overrides:
hashCodein classUnresolvedType
-
getDelegate
For a TypeVariableReferenceType the delegate is the delegate for the first bound.- Overrides:
getDelegatein classReferenceType
-
parameterize
Description copied from class:ResolvedTypeIff 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:
parameterizein classResolvedType
-
getTypeVariable
- Specified by:
getTypeVariablein interfaceTypeVariableReference
-
isTypeVariableReference
public boolean isTypeVariableReference()- Overrides:
isTypeVariableReferencein classUnresolvedType
-
toString
Description copied from class:UnresolvedTypeReturns a java language string representation of this type.- Overrides:
toStringin classUnresolvedType
-
isGenericWildcard
public boolean isGenericWildcard()- Overrides:
isGenericWildcardin classUnresolvedType
-
isAnnotation
public boolean isAnnotation()Description copied from class:ResolvedTypeNote: Only overridden by Name subtype.- Overrides:
isAnnotationin classReferenceType
-
getSignature
return the signature for a *REFERENCE* to a type variable, which is simply: Tname; there is no bounds info included, that is in the signature of the type variable itself- Overrides:
getSignaturein classUnresolvedType- Returns:
- the java JVM signature string for this type.
-
getTypeVariableName
- Returns:
- the name of the type variable
-
getUpperBound
-
resolve
resolve the type variable we are managing and then return this object. 'this' is already a ResolvedType but the type variable may transition from a not-resolved to a resolved state.- Overrides:
resolvein classUnresolvedType- Parameters:
world- theWorldwithin which to resolve.- Returns:
- a resolved type representing this type in the appropriate world.
-
isTypeVariableResolved
public boolean isTypeVariableResolved()- Returns:
- true if the type variable this reference is managing is resolved
-