public abstract class ResolvedType extends UnresolvedType implements AnnotatedElement
UnresolvedType.TypeKind
Modifier and Type | Field and Description |
---|---|
protected int |
bits |
CrosscuttingMembers |
crosscuttingMembers |
static ResolvedType[] |
EMPTY_ARRAY |
static ResolvedType[] |
EMPTY_RESOLVED_TYPE_ARRAY |
protected java.util.List<ConcreteTypeMunger> |
interTypeMungers |
static org.aspectj.weaver.ResolvedType.Missing |
MISSING |
static ResolvedType[] |
NONE |
static java.lang.String |
PARAMETERIZED_TYPE_IDENTIFIER |
ResolvedType[] |
temporaryAnnotationTypes |
protected static java.util.Set<java.lang.String> |
validBoxing |
protected World |
world |
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
Modifier | Constructor and Description |
---|---|
protected |
ResolvedType(java.lang.String signature,
java.lang.String signatureErasure,
World world) |
protected |
ResolvedType(java.lang.String signature,
World world) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AnnotationAJ annotationX) |
void |
addInterTypeMunger(ConcreteTypeMunger munger,
boolean isDuringCompilation)
Add an intertype munger to this type.
|
void |
addParent(ResolvedType newParent) |
protected boolean |
ajMembersNeedParameterization() |
boolean |
canAnnotationTargetType()
Note: Only overridden by ReferenceType subtype
|
void |
checkInterTypeMungers()
Check: 1) That we don't have any abstract type mungers unless this type is abstract.
|
boolean |
checkLegalOverride(ResolvedMember parent,
ResolvedMember child,
int transformerPosition,
ResolvedType aspectType) |
void |
clearInterTypeMungers() |
CrosscuttingMembers |
collectCrosscuttingMembers(boolean shouldConcretizeIfNeeded) |
java.util.List<Declare> |
collectDeclares(boolean includeAdviceLike) |
protected void |
collectInterTypeMungers(java.util.List<ConcreteTypeMunger> collector) |
static boolean |
conflictingSignature(Member m1,
Member m2) |
static boolean |
conflictingSignature(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.
|
ResolvedType |
discoverActualOccurrenceOfTypeInHierarchy(ResolvedType lookingFor)
Look up the actual occurence of a particular type in the hierarchy for 'this' type.
|
protected boolean |
doesNotExposeShadowMungers() |
void |
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).
|
boolean |
equals(java.lang.Object other)
Equality is checked based on the underlying signature.
|
ConcreteTypeMunger |
fillInAnyTypeParameters(ConcreteTypeMunger munger)
Called for all type mungers but only does something if they share type variables with a generic type which they target.
|
ResolvedPointcutDefinition |
findPointcut(java.lang.String name) |
protected java.util.Map<java.lang.String,UnresolvedType> |
getAjMemberParameterizationMap() |
AnnotationAJ |
getAnnotationOfType(UnresolvedType ofType) |
AnnotationAJ[] |
getAnnotations() |
AnnotationTargetKind[] |
getAnnotationTargetKinds()
Note: Only overridden by ReferenceType subtype
|
ResolvedType[] |
getAnnotationTypes() |
java.lang.String |
getBinaryPath()
Returns the path to the jar or class file from which this binary aspect came or null if not a binary aspect
|
int |
getCompilerVersion()
return the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.
|
java.util.List<ShadowMunger> |
getDeclaredAdvice() |
abstract ResolvedMember[] |
getDeclaredFields() |
abstract ResolvedType[] |
getDeclaredInterfaces() |
ResolvedMember[] |
getDeclaredJavaFields() |
ResolvedMember[] |
getDeclaredJavaMethods() |
abstract ResolvedMember[] |
getDeclaredMethods() |
abstract ResolvedMember[] |
getDeclaredPointcuts() |
java.util.List<ShadowMunger> |
getDeclaredShadowMungers() |
java.util.Collection<Declare> |
getDeclares() |
ResolvedType |
getDeclaringType()
Returns a ResolvedType object representing the declaring type of this type, or null if this type does not represent a
non-package-level-type.
|
java.util.Iterator<ResolvedType> |
getDirectSupertypes()
Returns an iterator through ResolvedType objects representing all the direct supertypes of this type.
|
java.util.List<ResolvedMember> |
getExposedPointcuts() |
java.util.Iterator<ResolvedMember> |
getFields()
returns an iterator through all of the fields of this type, in order for checking from JVM spec 2ed 5.4.3.2.
|
ReferenceType |
getGenericType()
Overridden by ReferenceType to return a sensible answer for parameterized and raw types.
|
java.util.Iterator<ResolvedType> |
getHierarchy()
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).
|
java.util.Iterator<ResolvedType> |
getHierarchy(boolean wantGenerics,
boolean wantDeclaredParents) |
java.util.List<ResolvedType> |
getHierarchyWithoutIterator(boolean includeITDs,
boolean allowMissing,
boolean genericsAware)
Return a list of the types in the hierarchy of this type, starting with this type.
|
java.util.List<ConcreteTypeMunger> |
getInterTypeMungers() |
java.util.List<ConcreteTypeMunger> |
getInterTypeMungersIncludingSupers()
??? This method is O(N*M) where N = number of methods and M is number of inter-type declarations in my super
|
java.util.List<ConcreteTypeMunger> |
getInterTypeParentMungers() |
java.util.List<ConcreteTypeMunger> |
getInterTypeParentMungersIncludingSupers() |
protected java.util.Map<java.lang.String,UnresolvedType> |
getMemberParameterizationMap() |
java.util.Iterator<ResolvedMember> |
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.
|
java.util.Iterator<ResolvedMember> |
getMethodsIncludingIntertypeDeclarations(boolean wantGenerics,
boolean wantDeclaredParents) |
java.util.List<ResolvedMember> |
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.
|
abstract int |
getModifiers() |
ResolvedType |
getOuterClass() |
PerClause |
getPerClause() |
java.util.Iterator<ResolvedMember> |
getPointcuts()
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).
|
java.util.Collection<ResolvedMember> |
getPrivilegedAccesses() |
ResolvedType |
getRawType() |
ResolvedType |
getResolvedComponentType() |
ResolvedType[] |
getResolvedTypeParameters() |
java.lang.String |
getSignatureForAttribute() |
int |
getSize()
This is the size of this type as used in JVM.
|
abstract ISourceContext |
getSourceContext() |
ISourceLocation |
getSourceLocation() |
abstract ResolvedType |
getSuperclass() |
ResolvedType |
getTopmostImplementor(ResolvedType interfaceType) |
java.util.Collection<ConcreteTypeMunger> |
getTypeMungers() |
WeaverStateInfo |
getWeaverState() |
World |
getWorld() |
boolean |
hasAnnotations() |
boolean |
isAbstract() |
boolean |
isAnnotation()
Note: Only overridden by Name subtype.
|
boolean |
isAnnotationStyleAspect() |
boolean |
isAnnotationWithRuntimeRetention()
Note: Only overridden by Name subtype.
|
boolean |
isAnonymous() |
boolean |
isAspect() |
abstract boolean |
isAssignableFrom(ResolvedType other)
Determines if the variables of this type could be assigned values of another type without casting.
|
abstract boolean |
isAssignableFrom(ResolvedType other,
boolean allowMissing) |
boolean |
isCacheable() |
boolean |
isCheckedException() |
boolean |
isClass() |
abstract boolean |
isCoerceableFrom(ResolvedType other)
Determines if values of another type could possibly be cast to this type.
|
boolean |
isConvertableFrom(ResolvedType other)
Determines if variables of this type could be assigned values of another with lots of help.
|
boolean |
isEnum()
Note: Only overridden by Name subtype.
|
boolean |
isException() |
boolean |
isExposedToWeaver() |
boolean |
isFinal() |
boolean |
isGroovyObject() |
boolean |
isInheritedAnnotation()
For an annotation type, this will return if it is marked with @Inherited
|
boolean |
isInterface() |
boolean |
isMissing() |
static boolean |
isMissing(UnresolvedType unresolved) |
static boolean |
isMoreVisible(int m1,
int m2) |
boolean |
isNested() |
boolean |
isParameterizedWithTypeVariable()
return true if the parameterization of this type includes a member type variable.
|
boolean |
isPrimitiveArray() |
boolean |
isSynthetic() |
boolean |
isTopmostImplementor(ResolvedType interfaceType) |
boolean |
isTypeHierarchyComplete() |
static boolean |
isVisible(int modifiers,
ResolvedType targetType,
ResolvedType fromType) |
ResolvedMember |
lookupDirectlyDeclaredMemberNoSupers(Member member)
as lookupMemberNoSupers, but does not include ITDs
|
ResolvedMember |
lookupField(Member field)
described in JVM spec 2ed 5.4.3.2
|
ResolvedMember |
lookupMemberIncludingITDsOnInterfaces(Member member)
This lookup has specialized behaviour - a null result tells the EclipseTypeMunger that it should make a default
implementation of a method on this type.
|
ResolvedMember |
lookupMemberNoSupers(Member member)
Look up a member, takes into account any ITDs on this type.
|
ResolvedMember |
lookupMemberWithSupersAndITDs(Member member) |
ResolvedMember |
lookupMethod(Member m)
described in JVM spec 2ed 5.4.3.3.
|
ResolvedMember |
lookupMethodInITDs(Member member) |
ResolvedMember |
lookupResolvedMember(ResolvedMember aMember,
boolean allowMissing,
boolean eraseGenerics)
Looks for the first member in the hierarchy matching aMember.
|
ResolvedMember |
lookupSyntheticMember(Member member) |
static ResolvedType |
makeArray(ResolvedType type,
int dim) |
static boolean |
matches(Member m1,
Member m2) |
boolean |
needsNoConversionFrom(ResolvedType o) |
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.
|
ResolvedType |
parameterizedWith(UnresolvedType[] typeParameters) |
void |
setBinaryPath(java.lang.String binaryPath) |
void |
tagAsTypeHierarchyComplete() |
add, forGenericType, forGenericTypeSignature, forGenericTypeVariables, forName, forNames, forPrimitiveType, forRawTypeName, forSignature, forSignatures, getBaseName, getClassName, getComponentType, getErasureSignature, getName, getNameAsIdentifier, getNames, getOutermostType, getPackageName, getPackageNameAsIdentifier, getRawName, getSignature, getSimpleBaseName, getSimpleName, getTypekind, getTypeParameters, getTypeVariableNamed, getTypeVariables, hashCode, insert, isArray, isGenericType, isGenericWildcard, isParameterizedOrGenericType, isParameterizedOrRawType, isParameterizedType, isPrimitiveType, isRawType, isSimpleType, isTypeVariableReference, isVoid, makeArray, needsModifiableDelegate, read, readArray, resolve, setNeedsModifiableDelegate, toDebugString, toString, toTraceString, write, writeArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
hasAnnotation
public static final ResolvedType[] EMPTY_RESOLVED_TYPE_ARRAY
public static final java.lang.String PARAMETERIZED_TYPE_IDENTIFIER
public ResolvedType[] temporaryAnnotationTypes
protected World world
protected int bits
protected static java.util.Set<java.lang.String> validBoxing
public CrosscuttingMembers crosscuttingMembers
public static final ResolvedType[] NONE
public static final ResolvedType[] EMPTY_ARRAY
public static final org.aspectj.weaver.ResolvedType.Missing MISSING
protected java.util.List<ConcreteTypeMunger> interTypeMungers
protected ResolvedType(java.lang.String signature, World world)
protected ResolvedType(java.lang.String signature, java.lang.String signatureErasure, World world)
public int getSize()
UnresolvedType
getSize
in class UnresolvedType
public final java.util.Iterator<ResolvedType> getDirectSupertypes()
public abstract ResolvedMember[] getDeclaredFields()
public abstract ResolvedMember[] getDeclaredMethods()
public abstract ResolvedType[] getDeclaredInterfaces()
public abstract ResolvedMember[] getDeclaredPointcuts()
public boolean isCacheable()
public abstract ResolvedType getSuperclass()
public abstract int getModifiers()
public boolean isMissing()
public static boolean isMissing(UnresolvedType unresolved)
public ResolvedType[] getAnnotationTypes()
getAnnotationTypes
in interface AnnotatedElement
public AnnotationAJ getAnnotationOfType(UnresolvedType ofType)
getAnnotationOfType
in interface AnnotatedElement
public ResolvedType getResolvedComponentType()
public World getWorld()
public boolean equals(java.lang.Object other)
UnresolvedType
equals
in class UnresolvedType
public java.util.Iterator<ResolvedMember> getFields()
public java.util.Iterator<ResolvedMember> getMethods(boolean wantGenerics, boolean wantDeclaredParents)
wantGenerics
- is true if the caller would like all generics information, otherwise those methods are collapsed to their
erasurepublic java.util.Iterator<ResolvedMember> getMethodsIncludingIntertypeDeclarations(boolean wantGenerics, boolean wantDeclaredParents)
public java.util.Iterator<ResolvedType> getHierarchy()
wantGenerics
- true if the caller wants full generic informationwantDeclaredParents
- true if the caller even wants those parents introduced via declare parentspublic java.util.Iterator<ResolvedType> getHierarchy(boolean wantGenerics, boolean wantDeclaredParents)
public java.util.List<ResolvedMember> getMethodsWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware)
public java.util.List<ResolvedType> getHierarchyWithoutIterator(boolean includeITDs, boolean allowMissing, boolean genericsAware)
genericsAware
- should the list include parameterized/generic types (if not, they will be collapsed to raw)?public ResolvedType[] getResolvedTypeParameters()
public ResolvedMember lookupField(Member field)
public ResolvedMember lookupMethod(Member m)
Check the current type for the method. If it is not found, check the super class and any super interfaces. Taking care not to process interfaces multiple times.
public ResolvedMember lookupMethodInITDs(Member member)
member
- the member to lookup in intertype declarations affecting this typepublic ResolvedMember lookupResolvedMember(ResolvedMember aMember, boolean allowMissing, boolean eraseGenerics)
public static boolean conflictingSignature(Member m1, Member m2, boolean v2itds)
public java.util.Iterator<ResolvedMember> getPointcuts()
public ResolvedPointcutDefinition findPointcut(java.lang.String name)
public CrosscuttingMembers collectCrosscuttingMembers(boolean shouldConcretizeIfNeeded)
public final java.util.List<Declare> collectDeclares(boolean includeAdviceLike)
public void addParent(ResolvedType newParent)
protected boolean doesNotExposeShadowMungers()
public PerClause getPerClause()
public java.util.Collection<Declare> getDeclares()
public java.util.Collection<ConcreteTypeMunger> getTypeMungers()
public java.util.Collection<ResolvedMember> getPrivilegedAccesses()
public final boolean isInterface()
public final boolean isAbstract()
public boolean isClass()
public boolean isAspect()
public boolean isAnnotationStyleAspect()
public boolean isEnum()
public boolean isAnnotation()
public boolean isAnonymous()
public boolean isNested()
public ResolvedType getOuterClass()
public void addAnnotation(AnnotationAJ annotationX)
public AnnotationAJ[] getAnnotations()
public boolean hasAnnotations()
public boolean canAnnotationTargetType()
public AnnotationTargetKind[] getAnnotationTargetKinds()
public boolean isAnnotationWithRuntimeRetention()
public boolean isSynthetic()
public final boolean isFinal()
protected java.util.Map<java.lang.String,UnresolvedType> getMemberParameterizationMap()
public java.util.List<ShadowMunger> getDeclaredAdvice()
public java.util.List<ShadowMunger> getDeclaredShadowMungers()
public ResolvedMember[] getDeclaredJavaFields()
public ResolvedMember[] getDeclaredJavaMethods()
public abstract ISourceContext getSourceContext()
public static ResolvedType makeArray(ResolvedType type, int dim)
public ResolvedMember lookupMemberNoSupers(Member member)
public ResolvedMember lookupMemberWithSupersAndITDs(Member member)
public ResolvedMember lookupDirectlyDeclaredMemberNoSupers(Member member)
member
- public ResolvedMember lookupMemberIncludingITDsOnInterfaces(Member member)
member
- public java.util.List<ConcreteTypeMunger> getInterTypeMungers()
public java.util.List<ConcreteTypeMunger> getInterTypeParentMungers()
public java.util.List<ConcreteTypeMunger> getInterTypeMungersIncludingSupers()
public java.util.List<ConcreteTypeMunger> getInterTypeParentMungersIncludingSupers()
protected void collectInterTypeMungers(java.util.List<ConcreteTypeMunger> collector)
public void checkInterTypeMungers()
public ResolvedType getDeclaringType()
public static boolean isVisible(int modifiers, ResolvedType targetType, ResolvedType fromType)
public ResolvedType discoverActualOccurrenceOfTypeInHierarchy(ResolvedType lookingFor)
public ConcreteTypeMunger fillInAnyTypeParameters(ConcreteTypeMunger munger)
public void addInterTypeMunger(ConcreteTypeMunger munger, boolean isDuringCompilation)
public boolean checkLegalOverride(ResolvedMember parent, ResolvedMember child, int transformerPosition, ResolvedType aspectType)
transformerPosition
- which parameter is the type transformer (0x10 for first, 0x01 for second, 0x11 for both, 0x00 for
neither)aspectType
- the declaring type of aspect defining the *first* type transformerpublic static boolean isMoreVisible(int m1, int m2)
public ResolvedMember lookupSyntheticMember(Member member)
public void clearInterTypeMungers()
public boolean isTopmostImplementor(ResolvedType interfaceType)
public ResolvedType getTopmostImplementor(ResolvedType interfaceType)
public java.util.List<ResolvedMember> getExposedPointcuts()
public ISourceLocation getSourceLocation()
public boolean isExposedToWeaver()
public WeaverStateInfo getWeaverState()
public ReferenceType getGenericType()
public ResolvedType getRawType()
getRawType
in class UnresolvedType
public ResolvedType parameterizedWith(UnresolvedType[] typeParameters)
public UnresolvedType parameterize(java.util.Map<java.lang.String,UnresolvedType> typeBindings)
parameterize
in class UnresolvedType
public boolean isException()
public boolean isCheckedException()
public final boolean isConvertableFrom(ResolvedType other)
other
- the other typeworld
- the World
in which the possible assignment should be checked.public abstract boolean isAssignableFrom(ResolvedType other)
other
- the other typeworld
- the World
in which the possible assignment should be checked.java.lang.NullPointerException
- if other is nullpublic abstract boolean isAssignableFrom(ResolvedType other, boolean allowMissing)
public abstract boolean isCoerceableFrom(ResolvedType other)
This method should be commutative, i.e., for all UnresolvedType a, b and all World w:
a.isCoerceableFrom(b, w) == b.isCoerceableFrom(a, w)
other
- the other typeworld
- the World
in which the possible coersion should be checked.java.lang.NullPointerException
- if other is null.public boolean needsNoConversionFrom(ResolvedType o)
public java.lang.String getSignatureForAttribute()
public boolean isParameterizedWithTypeVariable()
protected boolean ajMembersNeedParameterization()
protected java.util.Map<java.lang.String,UnresolvedType> getAjMemberParameterizationMap()
public void setBinaryPath(java.lang.String binaryPath)
public java.lang.String getBinaryPath()
public void ensureConsistent()
public boolean isInheritedAnnotation()
public void tagAsTypeHierarchyComplete()
public boolean isTypeHierarchyComplete()
public int getCompilerVersion()
AjAttribute.WeaverVersionInfo
public boolean isPrimitiveArray()
public boolean isGroovyObject()