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
FieldsFields inherited from class org.aspectj.weaver.ResolvedType
bits, crosscuttingMembers, EMPTY_RESOLVED_TYPE_ARRAY, interTypeMungers, MISSING, NONE, PARAMETERIZED_TYPE_IDENTIFIER, temporaryAnnotationTypes, validBoxing, worldFields 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
ConstructorsConstructorDescriptionReferenceType(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 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)booleanbooleanbooleanNote: Only overridden by Name subtype.booleanbooleanNote: 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 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, tagAsTypeHierarchyCompleteMethods 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, 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:
getSignatureForAttributein classResolvedType
-
isClass
public boolean isClass()- Overrides:
isClassin classResolvedType
-
getCompilerVersion
public int getCompilerVersion()Description copied from class:ResolvedTypereturn the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.- Overrides:
getCompilerVersionin classResolvedType- Returns:
- the (major) version,
AjAttribute.WeaverVersionInfo
-
isGenericType
public boolean isGenericType()- Overrides:
isGenericTypein classUnresolvedType
-
getGenericSignature
-
getAnnotations
- Overrides:
getAnnotationsin classResolvedType
-
hasAnnotations
public boolean hasAnnotations()- Overrides:
hasAnnotationsin classResolvedType
-
addAnnotation
- Overrides:
addAnnotationin classResolvedType
-
hasAnnotation
-
getAnnotationTypes
- Specified by:
getAnnotationTypesin interfaceAnnotatedElement- Overrides:
getAnnotationTypesin classResolvedType
-
getNameAsIdentifier
- Overrides:
getNameAsIdentifierin classUnresolvedType
-
getAnnotationOfType
- Specified by:
getAnnotationOfTypein interfaceAnnotatedElement- Overrides:
getAnnotationOfTypein classResolvedType
-
isAspect
public boolean isAspect()- Overrides:
isAspectin classResolvedType
-
isAnnotationStyleAspect
public boolean isAnnotationStyleAspect()- Overrides:
isAnnotationStyleAspectin classResolvedType
-
isEnum
public boolean isEnum()Description copied from class:ResolvedTypeNote: Only overridden by Name subtype.- Overrides:
isEnumin classResolvedType
-
isAnnotation
public boolean isAnnotation()Description copied from class:ResolvedTypeNote: Only overridden by Name subtype.- Overrides:
isAnnotationin classResolvedType
-
isAnonymous
public boolean isAnonymous()- Overrides:
isAnonymousin classResolvedType
-
isNested
public boolean isNested()- Overrides:
isNestedin classResolvedType
-
getOuterClass
- Overrides:
getOuterClassin classResolvedType
-
getRetentionPolicy
-
isAnnotationWithRuntimeRetention
public boolean isAnnotationWithRuntimeRetention()Description copied from class:ResolvedTypeNote: Only overridden by Name subtype.- Overrides:
isAnnotationWithRuntimeRetentionin classResolvedType
-
canAnnotationTargetType
public boolean canAnnotationTargetType()Description copied from class:ResolvedTypeNote: Only overridden by ReferenceType subtype- Overrides:
canAnnotationTargetTypein classResolvedType
-
getAnnotationTargetKinds
Description copied from class:ResolvedTypeNote: Only overridden by ReferenceType subtype- Overrides:
getAnnotationTargetKindsin classResolvedType
-
isCoerceableFrom
Description copied from class:ResolvedTypeDetermines 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:
isCoerceableFromin classResolvedType- Parameters:
o- the other type- Returns:
- true iff values of other could possibly be cast to this type.
-
isAssignableFrom
Description copied from class:ResolvedTypeDetermines 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:
isAssignableFromin classResolvedType- Parameters:
other- the other type- Returns:
- true iff variables of this type could be assigned values of other without casting
-
isAssignableFrom
- Specified by:
isAssignableFromin classResolvedType
-
getSourceContext
- Specified by:
getSourceContextin classResolvedType
-
getSourceLocation
- Overrides:
getSourceLocationin classResolvedType
-
isExposedToWeaver
public boolean isExposedToWeaver()- Overrides:
isExposedToWeaverin classResolvedType
-
getWeaverState
- Overrides:
getWeaverStatein classResolvedType
-
getDeclaredFields
- Specified by:
getDeclaredFieldsin 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:
getDeclaredInterfacesin classResolvedType
-
getDeclaredMethods
- Specified by:
getDeclaredMethodsin classResolvedType
-
getDeclaredPointcuts
- Specified by:
getDeclaredPointcutsin classResolvedType
-
getTypeVariables
- Overrides:
getTypeVariablesin classUnresolvedType
-
getPerClause
- Overrides:
getPerClausein classResolvedType
-
getDeclares
- Overrides:
getDeclaresin classResolvedType
-
getTypeMungers
- Overrides:
getTypeMungersin classResolvedType
-
getPrivilegedAccesses
- Overrides:
getPrivilegedAccessesin classResolvedType
-
getModifiers
public int getModifiers()- Specified by:
getModifiersin classResolvedType
-
getSuperclass
- Specified by:
getSuperclassin 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:
doesNotExposeShadowMungersin classResolvedType
-
getDeclaredGenericSignature
-
setGenericType
-
demoteToSimpleType
public void demoteToSimpleType() -
getGenericType
Description copied from class:ResolvedTypeOverridden by ReferenceType to return a sensible answer for parameterized and raw types.- Overrides:
getGenericTypein classResolvedType- Returns:
-
ensureConsistent
public void ensureConsistent()Description copied from class:ResolvedTypeUndo 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:
ensureConsistentin classResolvedType
-
addParent
- Overrides:
addParentin 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()
-