Top Description Fields Constructors Methods
org.aspectj.weaver

public Class ReferenceType

extends ResolvedType
Class Inheritance
Known Direct Subclasses
org.aspectj.weaver.TypeVariableReferenceType, org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXConverter.FTPHolder, org.aspectj.weaver.ArrayReferenceType, org.aspectj.weaver.BoundedReferenceType
Imports
java.lang.ref.WeakReference, java.util.ArrayList, .Collection, .List, .Map, org.aspectj.bridge.ISourceLocation, org.aspectj.weaver.World.TypeMap, org.aspectj.weaver.patterns.Declare, .PerClause

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.

Field Summary

Modifier and TypeField and Description
private AnnotationAJ[]
private ResolvedType[]
pack-priv ReferenceTypeDelegate
private final List<WeakReference<ReferenceType>>
derivativeTypes

For generic types, this list holds references to all the derived raw and parameterized versions.

public static final ReferenceType[]
pack-priv int
pack-priv ReferenceType
genericType

For parameterized types (or the raw type) - this field points to the actual reference type from which they are derived.

private ResolvedType[]
private ResolvedType
pack-priv Collection<Declare>
pack-priv ResolvedMember[]
pack-priv WeakReference<ResolvedType[]>
pack-priv ResolvedMember[]
pack-priv ResolvedMember[]
pack-priv ReferenceType
pack-priv int
pack-priv WeakReference<ResolvedType>
Inherited from org.aspectj.weaver.ResolvedType:
bitscrosscuttingMembersEMPTY_RESOLVED_TYPE_ARRAYinterTypeMungersMISSINGNONEPARAMETERIZED_TYPE_IDENTIFIERtemporaryAnnotationTypesvalidBoxingworld

Constructor Summary

AccessConstructor and Description
public
ReferenceType(String signature, World world)

public
ReferenceType(String signature, String signatureErasure, World world)

public
ReferenceType(ResolvedType theGenericType, ResolvedType[] theParameters, World aWorld)

Constructor used when creating a parameterized type.

public
ReferenceType(UnresolvedType genericType, World world)

Create a reference type for a generic type

Method Summary

Modifier and TypeMethod and Description
public void
private void
pack-priv synchronized void
public void
public boolean
canAnnotationTargetType()

Overrides org.aspectj.weaver.ResolvedType.canAnnotationTargetType.

Note

Only overridden by ReferenceType subtype

public void
private void
public void
private UnresolvedType[]
determineThoseTypesToUse(ResolvedType parameterizedInterface, UnresolvedType[] paramTypes)

It is possible this type has multiple type variables but the interface we are about to parameterize only uses a subset - this method determines the subset to use by looking at the type variable names used.

public boolean
public void
ensureConsistent()

Overrides org.aspectj.weaver.ResolvedType.ensureConsistent.

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).
private boolean
equal(UnresolvedType[] typeParameters, ResolvedType[] resolvedParameters)

private boolean
equal2(UnresolvedType[] typeParameters, UnresolvedType[] resolvedParameters)

public ReferenceType

Returns:

an existing derivative type or null if there isn't one
findDerivativeType
(ResolvedType[]
the type parameters to use when searching for the derivative type.
typeParameters
)

Look for a derivative type with the specified type parameters.

public static ReferenceType
public AnnotationAJ
public AnnotationAJ[]
public AnnotationTargetKind[]
getAnnotationTargetKinds()

Overrides org.aspectj.weaver.ResolvedType.getAnnotationTargetKinds.

Note

Only overridden by ReferenceType subtype

public ResolvedType[]
public int
getCompilerVersion()

Overrides org.aspectj.weaver.ResolvedType.getCompilerVersion.

return the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.
public ResolvedMember[]
public String
public ResolvedType[]
getDeclaredInterfaces()

Implements abstract org.aspectj.weaver.ResolvedType.getDeclaredInterfaces.

Find out from the generic signature the true signature of any interfaces I implement.
public ResolvedMember[]
public ResolvedMember[]
public Collection<Declare>
public ReferenceTypeDelegate
public int
public String
public ReferenceType
getGenericType()

Overrides org.aspectj.weaver.ResolvedType.getGenericType.

Overridden by ReferenceType to return a sensible answer for parameterized and raw types.
public int
public String
public ResolvedType
public PerClause
public Collection<ResolvedMember>
private int
getRank(String tvname)

Returns the position within the set of type variables for this type for the specified type variable name.

public String
public String
public ISourceContext
public ISourceLocation
public int
public ResolvedType
public Collection<ConcreteTypeMunger>
private UnresolvedType[]
public TypeVariable[]
public WeaverStateInfo
public boolean
public boolean
public boolean
public boolean
isAnnotation()

Overrides org.aspectj.weaver.ResolvedType.isAnnotation.

Note

Only overridden by Name subtype.

public boolean
public boolean
public boolean
public boolean
public boolean
isAssignableFrom(ResolvedType
the other type
other
)

Implements abstract org.aspectj.weaver.ResolvedType.isAssignableFrom.

Determines if the variables of this type could be assigned values of another type without casting.
public boolean
isAssignableFrom(ResolvedType other, boolean allowMissing)

Implements abstract org.aspectj.weaver.ResolvedType.isAssignableFrom.

public boolean
public boolean
isCoerceableFrom(ResolvedType
the other type
o
)

Implements abstract org.aspectj.weaver.ResolvedType.isCoerceableFrom.

Determines if values of another type could possibly be cast to this type.
private final boolean
public boolean
isEnum()

Overrides org.aspectj.weaver.ResolvedType.isEnum.

Note

Only overridden by Name subtype.

public boolean
public boolean
public boolean
private static String
makeDeclaredSignature(ResolvedType aGenericType, UnresolvedType[] someParameters)

private static String
makeParameterizedSignature(ResolvedType aGenericType, ResolvedType[] someParameters)

a parameterized signature starts with a "P" in place of the "L", see the comment on signatures in UnresolvedType.

public void
public void
setEndPos(int endPos)

public void
public void
setStartPos(int startPos)

Inherited from org.aspectj.weaver.ResolvedType:
addInterTypeMungerajMembersNeedParameterizationcanBeSeenBycheckInterTypeMungerscheckLegalOverrideclearInterTypeMungerscollectCrosscuttingMemberscollectDeclarescollectInterTypeMungersconflictingSignatureconflictingSignaturediscoverActualOccurrenceOfTypeInHierarchyequalsfillInAnyTypeParametersfindPointcutgetAjMemberParameterizationMapgetBinaryPathgetDeclaredAdvicegetDeclaredJavaFieldsgetDeclaredJavaMethodsgetDeclaredShadowMungersgetDeclaringTypegetDirectSupertypesgetExposedPointcutsgetFieldsgetHierarchygetHierarchygetHierarchyWithoutIteratorgetInterTypeMungersgetInterTypeMungersIncludingSupersgetInterTypeParentMungersgetInterTypeParentMungersIncludingSupersgetMemberParameterizationMapgetMethodsgetMethodsIncludingIntertypeDeclarationsgetMethodsWithoutIteratorgetPointcutsgetRawTypegetResolvedComponentTypegetResolvedTypeParametersgetSizegetTopmostImplementorgetWorldisAbstractisCacheableisCheckedExceptionisConvertableFromisExceptionisFinalisGroovyObjectisInheritedAnnotationisInterfaceisMissingisMissingisMoreVisibleisParameterizedWithTypeVariableisPrimitiveArrayisPrivilegedAspectisSyntheticisTopmostImplementorisTypeHierarchyCompleteisVisiblelookupDirectlyDeclaredMemberNoSuperslookupFieldlookupMemberIncludingITDsOnInterfaceslookupMemberNoSuperslookupMemberWithSupersAndITDslookupMethodlookupMethodInITDslookupResolvedMemberlookupSyntheticMembermakeArraymatchesneedsNoConversionFromparameterizeparameterizedWithsetBinaryPathtagAsTypeHierarchyComplete

Field Detail

annotationsback to summary
private AnnotationAJ[] annotations
annotationTypesback to summary
private ResolvedType[] annotationTypes
delegateback to summary
pack-priv ReferenceTypeDelegate delegate
derivativeTypesback to summary
private final List<WeakReference<ReferenceType>> derivativeTypes

For generic types, this list holds references to all the derived raw and parameterized versions. We need this so that if the generic delegate is swapped during incremental compilation, the delegate of the derivatives is swapped also.

EMPTY_ARRAYback to summary
public static final ReferenceType[] EMPTY_ARRAY

Hides org.aspectj.weaver.ResolvedType.EMPTY_ARRAY.

endPosback to summary
pack-priv int endPos
genericTypeback to summary
pack-priv ReferenceType genericType

For parameterized types (or the raw type) - this field points to the actual reference type from which they are derived.

newInterfacesback to summary
private ResolvedType[] newInterfaces
newSuperclassback to summary
private ResolvedType newSuperclass
parameterizedDeclaresback to summary
pack-priv Collection<Declare> parameterizedDeclares
parameterizedFieldsback to summary
pack-priv ResolvedMember[] parameterizedFields
parameterizedInterfacesback to summary
pack-priv WeakReference<ResolvedType[]> parameterizedInterfaces
parameterizedMethodsback to summary
pack-priv ResolvedMember[] parameterizedMethods
parameterizedPointcutsback to summary
pack-priv ResolvedMember[] parameterizedPointcuts
rawTypeback to summary
pack-priv ReferenceType rawType
startPosback to summary
pack-priv int startPos
superclassReferenceback to summary
pack-priv WeakReference<ResolvedType> superclassReference

Constructor Detail

ReferenceTypeback to summary
public ReferenceType(String signature, World world)
ReferenceTypeback to summary
public ReferenceType(String signature, String signatureErasure, World world)
ReferenceTypeback to summary
public ReferenceType(ResolvedType theGenericType, ResolvedType[] theParameters, World aWorld)

Constructor used when creating a parameterized type.

ReferenceTypeback to summary
public ReferenceType(UnresolvedType genericType, World world)

Create a reference type for a generic type

Method Detail

addAnnotationback to summary
public void addAnnotation(AnnotationAJ annotationX)

Overrides org.aspectj.weaver.ResolvedType.addAnnotation.

Annotations
@Override
addAnnotationTypeback to summary
private void addAnnotationType(ResolvedType ofType)
addDependentTypeback to summary
pack-priv synchronized void addDependentType(ReferenceType dependent)
addParentback to summary
public void addParent(ResolvedType newParent)

Overrides org.aspectj.weaver.ResolvedType.addParent.

Annotations
@Override
canAnnotationTargetTypeback to summary
public boolean canAnnotationTargetType()

Overrides org.aspectj.weaver.ResolvedType.canAnnotationTargetType.

Doc from org.aspectj.weaver.ResolvedType.canAnnotationTargetType.

Note

Only overridden by ReferenceType subtype

Annotations
@Override
checkDuplicatesback to summary
public void checkDuplicates(ReferenceType newRt)
clearParameterizationCachesback to summary
private void clearParameterizationCaches()
demoteToSimpleTypeback to summary
public void demoteToSimpleType()
determineThoseTypesToUseback to summary
private UnresolvedType[] determineThoseTypesToUse(ResolvedType parameterizedInterface, UnresolvedType[] paramTypes)

It is possible this type has multiple type variables but the interface we are about to parameterize only uses a subset - this method determines the subset to use by looking at the type variable names used. For example: class Foo implements SuperInterface {} where interface SuperInterface {} In that example, a use of the 'Foo' raw type should know that it implements the SuperInterface.

doesNotExposeShadowMungersback to summary
public boolean doesNotExposeShadowMungers()

Overrides org.aspectj.weaver.ResolvedType.doesNotExposeShadowMungers.

Annotations
@Override
ensureConsistentback to summary
public void ensureConsistent()

Overrides org.aspectj.weaver.ResolvedType.ensureConsistent.

Doc from org.aspectj.weaver.ResolvedType.ensureConsistent.

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).

Annotations
@Override
equalback to summary
private boolean equal(UnresolvedType[] typeParameters, ResolvedType[] resolvedParameters)
equal2back to summary
private boolean equal2(UnresolvedType[] typeParameters, UnresolvedType[] resolvedParameters)
findDerivativeTypeback to summary
public ReferenceType findDerivativeType(ResolvedType[] typeParameters)

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:ResolvedType[]

the type parameters to use when searching for the derivative type.

Returns:ReferenceType

an existing derivative type or null if there isn't one

fromTypeXback to summary
public static ReferenceType fromTypeX(UnresolvedType tx, World world)
getAnnotationOfTypeback to summary
public AnnotationAJ getAnnotationOfType(UnresolvedType ofType)

Overrides org.aspectj.weaver.ResolvedType.getAnnotationOfType.

Implements org.aspectj.weaver.AnnotatedElement.getAnnotationOfType.

Annotations
@Override
getAnnotationsback to summary
public AnnotationAJ[] getAnnotations()

Overrides org.aspectj.weaver.ResolvedType.getAnnotations.

Annotations
@Override
getAnnotationTargetKindsback to summary
public AnnotationTargetKind[] getAnnotationTargetKinds()

Overrides org.aspectj.weaver.ResolvedType.getAnnotationTargetKinds.

Doc from org.aspectj.weaver.ResolvedType.getAnnotationTargetKinds.

Note

Only overridden by ReferenceType subtype

Annotations
@Override
getAnnotationTypesback to summary
public ResolvedType[] getAnnotationTypes()

Overrides org.aspectj.weaver.ResolvedType.getAnnotationTypes.

Implements org.aspectj.weaver.AnnotatedElement.getAnnotationTypes.

Annotations
@Override
getCompilerVersionback to summary
public int getCompilerVersion()

Overrides org.aspectj.weaver.ResolvedType.getCompilerVersion.

Doc from org.aspectj.weaver.ResolvedType.getCompilerVersion.

return the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.

Returns:int

the (major) version, WeaverVersionInfo

Annotations
@Override
getDeclaredFieldsback to summary
public ResolvedMember[] getDeclaredFields()

Implements abstract org.aspectj.weaver.ResolvedType.getDeclaredFields.

Annotations
@Override
getDeclaredGenericSignatureback to summary
public String getDeclaredGenericSignature()
getDeclaredInterfacesback to summary
public ResolvedType[] getDeclaredInterfaces()

Implements abstract org.aspectj.weaver.ResolvedType.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.

Annotations
@Override
getDeclaredMethodsback to summary
public ResolvedMember[] getDeclaredMethods()

Implements abstract org.aspectj.weaver.ResolvedType.getDeclaredMethods.

Annotations
@Override
getDeclaredPointcutsback to summary
public ResolvedMember[] getDeclaredPointcuts()

Implements abstract org.aspectj.weaver.ResolvedType.getDeclaredPointcuts.

Annotations
@Override
getDeclaresback to summary
public Collection<Declare> getDeclares()

Overrides org.aspectj.weaver.ResolvedType.getDeclares.

Annotations
@Override
getDelegateback to summary
public ReferenceTypeDelegate getDelegate()
getEndPosback to summary
public int getEndPos()
getGenericSignatureback to summary
public String getGenericSignature()
getGenericTypeback to summary
public ReferenceType getGenericType()

Overrides org.aspectj.weaver.ResolvedType.getGenericType.

Doc from org.aspectj.weaver.ResolvedType.getGenericType.

Overridden by ReferenceType to return a sensible answer for parameterized and raw types.

Annotations
@Override
getModifiersback to summary
public int getModifiers()

Implements abstract org.aspectj.weaver.ResolvedType.getModifiers.

Annotations
@Override
getNameAsIdentifierback to summary
public String getNameAsIdentifier()

Overrides org.aspectj.weaver.UnresolvedType.getNameAsIdentifier.

Annotations
@Override
getOuterClassback to summary
public ResolvedType getOuterClass()

Overrides org.aspectj.weaver.ResolvedType.getOuterClass.

getPerClauseback to summary
public PerClause getPerClause()

Overrides org.aspectj.weaver.ResolvedType.getPerClause.

Annotations
@Override
getPrivilegedAccessesback to summary
public Collection<ResolvedMember> getPrivilegedAccesses()

Overrides org.aspectj.weaver.ResolvedType.getPrivilegedAccesses.

Annotations
@Override
getRankback to summary
private int getRank(String tvname)

Returns the position within the set of type variables for this type for the specified type variable name. Returns -1 if there is no type variable with the specified name.

getRetentionPolicyback to summary
public String getRetentionPolicy()
getSignatureForAttributeback to summary
public String getSignatureForAttribute()

Overrides org.aspectj.weaver.ResolvedType.getSignatureForAttribute.

Annotations
@Override
getSourceContextback to summary
public ISourceContext getSourceContext()

Implements abstract org.aspectj.weaver.ResolvedType.getSourceContext.

Annotations
@Override
getSourceLocationback to summary
public ISourceLocation getSourceLocation()

Overrides org.aspectj.weaver.ResolvedType.getSourceLocation.

Annotations
@Override
getStartPosback to summary
public int getStartPos()
getSuperclassback to summary
public ResolvedType getSuperclass()

Implements abstract org.aspectj.weaver.ResolvedType.getSuperclass.

Returns:ResolvedType

Doc from org.aspectj.weaver.ResolvedType.getSuperclass.

the superclass of this type, or null (if this represents a jlObject, primitive, or void)

Annotations
@Override
getTypeMungersback to summary
public Collection<ConcreteTypeMunger> getTypeMungers()

Overrides org.aspectj.weaver.ResolvedType.getTypeMungers.

Annotations
@Override
getTypesForMemberParameterizationback to summary
private UnresolvedType[] getTypesForMemberParameterization()
getTypeVariablesback to summary
public TypeVariable[] getTypeVariables()

Overrides org.aspectj.weaver.UnresolvedType.getTypeVariables.

Annotations
@Override
getWeaverStateback to summary
public WeaverStateInfo getWeaverState()

Overrides org.aspectj.weaver.ResolvedType.getWeaverState.

Annotations
@Override
hasAnnotationback to summary
public boolean hasAnnotation(UnresolvedType ofType)

Implements org.aspectj.weaver.AnnotatedElement.hasAnnotation.

hasAnnotationsback to summary
public boolean hasAnnotations()

Overrides org.aspectj.weaver.ResolvedType.hasAnnotations.

Annotations
@Override
hasNewInterfacesback to summary
public boolean hasNewInterfaces()
isAnnotationback to summary
public boolean isAnnotation()

Overrides org.aspectj.weaver.ResolvedType.isAnnotation.

Doc from org.aspectj.weaver.ResolvedType.isAnnotation.

Note

Only overridden by Name subtype.

Annotations
@Override
isAnnotationStyleAspectback to summary
public boolean isAnnotationStyleAspect()

Overrides org.aspectj.weaver.ResolvedType.isAnnotationStyleAspect.

Annotations
@Override
isAnnotationWithRuntimeRetentionback to summary
public boolean isAnnotationWithRuntimeRetention()

Overrides org.aspectj.weaver.ResolvedType.isAnnotationWithRuntimeRetention.

Doc from org.aspectj.weaver.ResolvedType.isAnnotationWithRuntimeRetention.

Note

Only overridden by Name subtype.

Annotations
@Override
isAnonymousback to summary
public boolean isAnonymous()

Overrides org.aspectj.weaver.ResolvedType.isAnonymous.

Annotations
@Override
isAspectback to summary
public boolean isAspect()

Overrides org.aspectj.weaver.ResolvedType.isAspect.

Annotations
@Override
isAssignableFromback to summary
public boolean isAssignableFrom(ResolvedType other)

Implements abstract org.aspectj.weaver.ResolvedType.isAssignableFrom.

Doc from org.aspectj.weaver.ResolvedType.isAssignableFrom.

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).

Parameters
other:ResolvedType

the other type

Returns:boolean

true iff variables of this type could be assigned values of other without casting

Annotations
@Override
isAssignableFromback to summary
public boolean isAssignableFrom(ResolvedType other, boolean allowMissing)

Implements abstract org.aspectj.weaver.ResolvedType.isAssignableFrom.

Annotations
@Override
isClassback to summary
public boolean isClass()

Overrides org.aspectj.weaver.ResolvedType.isClass.

Annotations
@Override
isCoerceableFromback to summary
public boolean isCoerceableFrom(ResolvedType o)

Implements abstract org.aspectj.weaver.ResolvedType.isCoerceableFrom.

Doc from org.aspectj.weaver.ResolvedType.isCoerceableFrom.

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)
Parameters
o:ResolvedType

the other type

Returns:boolean

true iff values of other could possibly be cast to this type.

Annotations
@Override
isCoerceableFromParameterizedTypeback to summary
private final boolean isCoerceableFromParameterizedType(ResolvedType other)
isEnumback to summary
public boolean isEnum()

Overrides org.aspectj.weaver.ResolvedType.isEnum.

Doc from org.aspectj.weaver.ResolvedType.isEnum.

Note

Only overridden by Name subtype.

Annotations
@Override
isExposedToWeaverback to summary
public boolean isExposedToWeaver()

Overrides org.aspectj.weaver.ResolvedType.isExposedToWeaver.

Annotations
@Override
isGenericTypeback to summary
public boolean isGenericType()

Overrides org.aspectj.weaver.UnresolvedType.isGenericType.

Annotations
@Override
isNestedback to summary
public boolean isNested()

Overrides org.aspectj.weaver.ResolvedType.isNested.

Annotations
@Override
makeDeclaredSignatureback to summary
private static String makeDeclaredSignature(ResolvedType aGenericType, UnresolvedType[] someParameters)
makeParameterizedSignatureback to summary
private static String makeParameterizedSignature(ResolvedType aGenericType, ResolvedType[] someParameters)

a parameterized signature starts with a "P" in place of the "L", see the comment on signatures in UnresolvedType.

setDelegateback to summary
public void setDelegate(ReferenceTypeDelegate delegate)
setEndPosback to summary
public void setEndPos(int endPos)
setGenericTypeback to summary
public void setGenericType(ReferenceType rt)
setStartPosback to summary
public void setStartPos(int startPos)