Package org.aspectj.weaver
Class ReferenceType
java.lang.Object
org.aspectj.weaver.UnresolvedType
org.aspectj.weaver.ResolvedType
org.aspectj.weaver.ReferenceType
- All Implemented Interfaces:
AnnotatedElement
,Traceable
,TypeVariableDeclaringElement
- Direct Known Subclasses:
ArrayReferenceType
,BoundedReferenceType
,TypeVariableReferenceType
A reference type represents some 'real' type, not a primitive, not an array -
but a real type, for example java.util.List. Each ReferenceType has a
delegate that is the underlying artifact - either an eclipse artifact or a
bcel artifact. If the type represents a raw type (i.e. there is a generic
form) then the genericType field is set to point to the generic type. If it
is for a parameterized type then the generic type is also set to point to the
generic form.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.aspectj.weaver.UnresolvedType
UnresolvedType.TypeKind
-
Field Summary
Fields inherited from class org.aspectj.weaver.ResolvedType
bits, crosscuttingMembers, EMPTY_RESOLVED_TYPE_ARRAY, interTypeMungers, MISSING, NONE, PARAMETERIZED_TYPE_IDENTIFIER, temporaryAnnotationTypes, validBoxing, world
Fields inherited from class org.aspectj.weaver.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, VOID
-
Constructor Summary
ConstructorDescriptionReferenceType
(String signature, String signatureErasure, World world) ReferenceType
(String signature, World world) ReferenceType
(ResolvedType theGenericType, ResolvedType[] theParameters, World aWorld) Constructor used when creating a parameterized type.ReferenceType
(UnresolvedType genericType, World world) Create a reference type for a generic type -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAnnotation
(AnnotationAJ annotationX) void
addParent
(ResolvedType newParent) boolean
Note: Only overridden by ReferenceType subtypevoid
checkDuplicates
(ReferenceType newRt) void
boolean
void
Undo 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 ReferenceType
fromTypeX
(UnresolvedType tx, World world) getAnnotationOfType
(UnresolvedType ofType) Note: Only overridden by ReferenceType subtypeint
return 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.int
Overridden by ReferenceType to return a sensible answer for parameterized and raw types.int
int
boolean
hasAnnotation
(UnresolvedType ofType) boolean
boolean
boolean
Note: Only overridden by Name subtype.boolean
boolean
Note: Only overridden by Name subtype.boolean
boolean
isAspect()
boolean
isAssignableFrom
(ResolvedType other) Determines if the variables of this type could be assigned values of another type without casting.boolean
isAssignableFrom
(ResolvedType other, boolean allowMissing) boolean
isClass()
boolean
Determines if values of another type could possibly be cast to this type.boolean
isEnum()
Note: Only overridden by Name subtype.boolean
boolean
boolean
isNested()
void
setDelegate
(ReferenceTypeDelegate delegate) void
setEndPos
(int endPos) void
void
setStartPos
(int startPos) Methods inherited from class org.aspectj.weaver.ResolvedType
addInterTypeMunger, ajMembersNeedParameterization, canBeSeenBy, checkInterTypeMungers, checkLegalOverride, clearInterTypeMungers, collectCrosscuttingMembers, collectDeclares, collectInterTypeMungers, conflictingSignature, 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, isPrivilegedAspect, isSynthetic, isTopmostImplementor, isTypeHierarchyComplete, isVisible, lookupDirectlyDeclaredMemberNoSupers, lookupField, lookupMemberIncludingITDsOnInterfaces, lookupMemberNoSupers, lookupMemberWithSupersAndITDs, lookupMethod, lookupMethodInITDs, lookupResolvedMember, lookupSyntheticMember, makeArray, matches, needsNoConversionFrom, parameterize, parameterizedWith, setBinaryPath, tagAsTypeHierarchyComplete
Methods inherited from class org.aspectj.weaver.UnresolvedType
add, forGenericType, forGenericTypeSignature, forGenericTypeVariables, forName, forNames, forPrimitiveType, forRawTypeName, forSignature, forSignatures, getBaseName, getClassName, getComponentType, getDimensions, getErasureSignature, getName, getNames, getOutermostType, getPackageName, getPackageNameAsIdentifier, getRawName, getSignature, getSimpleBaseName, getSimpleName, getTypekind, getTypeParameters, getTypeVariableNamed, hashCode, insert, isArray, isGenericWildcard, isParameterizedOrGenericType, isParameterizedOrRawType, isParameterizedType, isPrimitiveType, isRawType, isSimpleType, isTypeVariableReference, isVoid, makeArray, needsModifiableDelegate, read, readArray, resolve, setNeedsModifiableDelegate, toDebugString, toString, toTraceString, write, writeArray
-
Field Details
-
EMPTY_ARRAY
-
-
Constructor Details
-
ReferenceType
-
ReferenceType
-
ReferenceType
Constructor used when creating a parameterized type. -
ReferenceType
Create a reference type for a generic type
-
-
Method Details
-
fromTypeX
-
checkDuplicates
-
getSignatureForAttribute
- Overrides:
getSignatureForAttribute
in classResolvedType
-
isClass
public boolean isClass()- Overrides:
isClass
in classResolvedType
-
getCompilerVersion
public int getCompilerVersion()Description copied from class:ResolvedType
return the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.- Overrides:
getCompilerVersion
in classResolvedType
- Returns:
- the (major) version,
AjAttribute.WeaverVersionInfo
-
isGenericType
public boolean isGenericType()- Overrides:
isGenericType
in classUnresolvedType
-
getGenericSignature
-
getAnnotations
- Overrides:
getAnnotations
in classResolvedType
-
hasAnnotations
public boolean hasAnnotations()- Overrides:
hasAnnotations
in classResolvedType
-
addAnnotation
- Overrides:
addAnnotation
in classResolvedType
-
hasAnnotation
-
getAnnotationTypes
- Specified by:
getAnnotationTypes
in interfaceAnnotatedElement
- Overrides:
getAnnotationTypes
in classResolvedType
-
getNameAsIdentifier
- Overrides:
getNameAsIdentifier
in classUnresolvedType
-
getAnnotationOfType
- Specified by:
getAnnotationOfType
in interfaceAnnotatedElement
- Overrides:
getAnnotationOfType
in classResolvedType
-
isAspect
public boolean isAspect()- Overrides:
isAspect
in classResolvedType
-
isAnnotationStyleAspect
public boolean isAnnotationStyleAspect()- Overrides:
isAnnotationStyleAspect
in classResolvedType
-
isEnum
public boolean isEnum()Description copied from class:ResolvedType
Note: Only overridden by Name subtype.- Overrides:
isEnum
in classResolvedType
-
isAnnotation
public boolean isAnnotation()Description copied from class:ResolvedType
Note: Only overridden by Name subtype.- Overrides:
isAnnotation
in classResolvedType
-
isAnonymous
public boolean isAnonymous()- Overrides:
isAnonymous
in classResolvedType
-
isNested
public boolean isNested()- Overrides:
isNested
in classResolvedType
-
getOuterClass
- Overrides:
getOuterClass
in classResolvedType
-
getRetentionPolicy
-
isAnnotationWithRuntimeRetention
public boolean isAnnotationWithRuntimeRetention()Description copied from class:ResolvedType
Note: Only overridden by Name subtype.- Overrides:
isAnnotationWithRuntimeRetention
in classResolvedType
-
canAnnotationTargetType
public boolean canAnnotationTargetType()Description copied from class:ResolvedType
Note: Only overridden by ReferenceType subtype- Overrides:
canAnnotationTargetType
in classResolvedType
-
getAnnotationTargetKinds
Description copied from class:ResolvedType
Note: Only overridden by ReferenceType subtype- Overrides:
getAnnotationTargetKinds
in classResolvedType
-
isCoerceableFrom
Description copied from class:ResolvedType
Determines if values of another type could possibly be cast to this type. The rules followed are from JLS 2ed 5.5, "Casting Conversion".This method should be commutative, i.e., for all UnresolvedType a, b and all World w:
a.isCoerceableFrom(b, w) == b.isCoerceableFrom(a, w)
- Specified by:
isCoerceableFrom
in classResolvedType
- Parameters:
o
- the other type- Returns:
- true iff values of other could possibly be cast to this type.
-
isAssignableFrom
Description copied from class:ResolvedType
Determines if the variables of this type could be assigned values of another type without casting. This still allows for assignment conversion as per JLS 2ed 5.2. For object types, this means supertypeOrEqual(THIS, OTHER).- Specified by:
isAssignableFrom
in classResolvedType
- Parameters:
other
- the other type- Returns:
- true iff variables of this type could be assigned values of other without casting
-
isAssignableFrom
- Specified by:
isAssignableFrom
in classResolvedType
-
getSourceContext
- Specified by:
getSourceContext
in classResolvedType
-
getSourceLocation
- Overrides:
getSourceLocation
in classResolvedType
-
isExposedToWeaver
public boolean isExposedToWeaver()- Overrides:
isExposedToWeaver
in classResolvedType
-
getWeaverState
- Overrides:
getWeaverState
in classResolvedType
-
getDeclaredFields
- Specified by:
getDeclaredFields
in classResolvedType
-
getDeclaredInterfaces
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.- Specified by:
getDeclaredInterfaces
in classResolvedType
-
getDeclaredMethods
- Specified by:
getDeclaredMethods
in classResolvedType
-
getDeclaredPointcuts
- Specified by:
getDeclaredPointcuts
in classResolvedType
-
getTypeVariables
- Overrides:
getTypeVariables
in classUnresolvedType
-
getPerClause
- Overrides:
getPerClause
in classResolvedType
-
getDeclares
- Overrides:
getDeclares
in classResolvedType
-
getTypeMungers
- Overrides:
getTypeMungers
in classResolvedType
-
getPrivilegedAccesses
- Overrides:
getPrivilegedAccesses
in classResolvedType
-
getModifiers
public int getModifiers()- Specified by:
getModifiers
in classResolvedType
-
getSuperclass
- Specified by:
getSuperclass
in classResolvedType
- Returns:
- the superclass of this type, or null (if this represents a jlObject, primitive, or void)
-
getDelegate
-
setDelegate
-
getEndPos
public int getEndPos() -
getStartPos
public int getStartPos() -
setEndPos
public void setEndPos(int endPos) -
setStartPos
public void setStartPos(int startPos) -
doesNotExposeShadowMungers
public boolean doesNotExposeShadowMungers()- Overrides:
doesNotExposeShadowMungers
in classResolvedType
-
getDeclaredGenericSignature
-
setGenericType
-
demoteToSimpleType
public void demoteToSimpleType() -
getGenericType
Description copied from class:ResolvedType
Overridden by ReferenceType to return a sensible answer for parameterized and raw types.- Overrides:
getGenericType
in classResolvedType
- Returns:
-
ensureConsistent
public void ensureConsistent()Description copied from class:ResolvedType
Undo 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).- Overrides:
ensureConsistent
in classResolvedType
-
addParent
- Overrides:
addParent
in classResolvedType
-
findDerivativeType
Look for a derivative type with the specified type parameters. This can avoid creating an unnecessary new (duplicate) with the same information in it. This method also cleans up any reference entries that have been null'd by a GC.- Parameters:
typeParameters
- the type parameters to use when searching for the derivative type.- Returns:
- an existing derivative type or null if there isn't one
-
hasNewInterfaces
public boolean hasNewInterfaces()
-