org.aspectj.weaver
Class ResolvedType

java.lang.Object
  extended by org.aspectj.weaver.UnresolvedType
      extended by org.aspectj.weaver.ResolvedType
All Implemented Interfaces:
AnnotatedElement, Traceable, TypeVariableDeclaringElement
Direct Known Subclasses:
MissingResolvedTypeWithKnownSignature, ReferenceType

public abstract class ResolvedType
extends UnresolvedType
implements AnnotatedElement


Nested Class Summary
 
Nested classes/interfaces inherited from class org.aspectj.weaver.UnresolvedType
UnresolvedType.TypeKind
 
Field Summary
 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
           
 
Fields inherited from class org.aspectj.weaver.UnresolvedType
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
 
Constructor Summary
protected ResolvedType(java.lang.String signature, java.lang.String signatureErasure, World world)
           
protected ResolvedType(java.lang.String signature, World world)
           
 
Method Summary
 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 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()
           
 
Methods inherited from class org.aspectj.weaver.UnresolvedType
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.aspectj.weaver.AnnotatedElement
hasAnnotation
 

Field Detail

EMPTY_RESOLVED_TYPE_ARRAY

public static final ResolvedType[] EMPTY_RESOLVED_TYPE_ARRAY

PARAMETERIZED_TYPE_IDENTIFIER

public static final java.lang.String PARAMETERIZED_TYPE_IDENTIFIER
See Also:
Constant Field Values

temporaryAnnotationTypes

public ResolvedType[] temporaryAnnotationTypes

world

protected World world

validBoxing

protected static java.util.Set<java.lang.String> validBoxing

crosscuttingMembers

public CrosscuttingMembers crosscuttingMembers

NONE

public static final ResolvedType[] NONE

EMPTY_ARRAY

public static final ResolvedType[] EMPTY_ARRAY

MISSING

public static final org.aspectj.weaver.ResolvedType.Missing MISSING

interTypeMungers

protected java.util.List<ConcreteTypeMunger> interTypeMungers
Constructor Detail

ResolvedType

protected ResolvedType(java.lang.String signature,
                       World world)

ResolvedType

protected ResolvedType(java.lang.String signature,
                       java.lang.String signatureErasure,
                       World world)
Method Detail

getSize

public int getSize()
Description copied from class: UnresolvedType
This is the size of this type as used in JVM.

Overrides:
getSize in class UnresolvedType

getDirectSupertypes

public final java.util.Iterator<ResolvedType> getDirectSupertypes()
Returns an iterator through ResolvedType objects representing all the direct supertypes of this type. That is, through the superclass, if any, and all declared interfaces.


getDeclaredFields

public abstract ResolvedMember[] getDeclaredFields()

getDeclaredMethods

public abstract ResolvedMember[] getDeclaredMethods()

getDeclaredInterfaces

public abstract ResolvedType[] getDeclaredInterfaces()

getDeclaredPointcuts

public abstract ResolvedMember[] getDeclaredPointcuts()

isCacheable

public boolean isCacheable()

getSuperclass

public abstract ResolvedType getSuperclass()
Returns:
the superclass of this type, or null (if this represents a jlObject, primitive, or void)

getModifiers

public abstract int getModifiers()

isMissing

public boolean isMissing()

isMissing

public static boolean isMissing(UnresolvedType unresolved)

getAnnotationTypes

public ResolvedType[] getAnnotationTypes()
Specified by:
getAnnotationTypes in interface AnnotatedElement

getAnnotationOfType

public AnnotationAJ getAnnotationOfType(UnresolvedType ofType)
Specified by:
getAnnotationOfType in interface AnnotatedElement

getResolvedComponentType

public ResolvedType getResolvedComponentType()

getWorld

public World getWorld()

equals

public boolean equals(java.lang.Object other)
Description copied from class: UnresolvedType
Equality is checked based on the underlying signature.

Overrides:
equals in class UnresolvedType

getFields

public 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. This means that the order is

We keep a hashSet of interfaces that we've visited so we don't spiral out into 2^n land.


getMethods

public 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. This means that the order is

Parameters:
wantGenerics - is true if the caller would like all generics information, otherwise those methods are collapsed to their erasure

getMethodsIncludingIntertypeDeclarations

public java.util.Iterator<ResolvedMember> getMethodsIncludingIntertypeDeclarations(boolean wantGenerics,
                                                                                   boolean wantDeclaredParents)

getHierarchy

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

Parameters:
wantGenerics - true if the caller wants full generic information
wantDeclaredParents - true if the caller even wants those parents introduced via declare parents
Returns:
an iterator over all types in the hierarchy of this type

getHierarchy

public java.util.Iterator<ResolvedType> getHierarchy(boolean wantGenerics,
                                                     boolean wantDeclaredParents)

getMethodsWithoutIterator

public 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. This is expensive - use the getMethods() method if you can!


getHierarchyWithoutIterator

public 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. The order in the list is the superclasses followed by the super interfaces.

Parameters:
genericsAware - should the list include parameterized/generic types (if not, they will be collapsed to raw)?
Returns:
list of resolvedtypes in this types hierarchy, including this type first

getResolvedTypeParameters

public ResolvedType[] getResolvedTypeParameters()

lookupField

public ResolvedMember lookupField(Member field)
described in JVM spec 2ed 5.4.3.2


lookupMethod

public ResolvedMember lookupMethod(Member m)
described in JVM spec 2ed 5.4.3.3. Doesnt check ITDs.

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.


lookupMethodInITDs

public ResolvedMember lookupMethodInITDs(Member member)
Parameters:
member - the member to lookup in intertype declarations affecting this type
Returns:
the real signature defined by any matching intertype declaration, otherwise null

lookupResolvedMember

public ResolvedMember lookupResolvedMember(ResolvedMember aMember,
                                           boolean allowMissing,
                                           boolean eraseGenerics)
Looks for the first member in the hierarchy matching aMember. This method differs from lookupMember(Member) in that it takes into account parameters which are type variables - which clearly an unresolved Member cannot do since it does not know anything about type variables.


matches

public static boolean matches(Member m1,
                              Member m2)

conflictingSignature

public static boolean conflictingSignature(Member m1,
                                           Member m2)

conflictingSignature

public 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. The conflict detection below had to be altered. Previously (<1.7.1) it is not a conflict if the declaring types are different. With v2itds it may still be a conflict if the declaring types are different.


getPointcuts

public 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). This means that the order is

We keep a hashSet of interfaces that we've visited so we don't spiral out into 2^n land.


findPointcut

public ResolvedPointcutDefinition findPointcut(java.lang.String name)

collectCrosscuttingMembers

public CrosscuttingMembers collectCrosscuttingMembers(boolean shouldConcretizeIfNeeded)

collectDeclares

public final java.util.List<Declare> collectDeclares(boolean includeAdviceLike)

addParent

public void addParent(ResolvedType newParent)

doesNotExposeShadowMungers

protected boolean doesNotExposeShadowMungers()

getPerClause

public PerClause getPerClause()

getDeclares

public java.util.Collection<Declare> getDeclares()

getTypeMungers

public java.util.Collection<ConcreteTypeMunger> getTypeMungers()

getPrivilegedAccesses

public java.util.Collection<ResolvedMember> getPrivilegedAccesses()

isInterface

public final boolean isInterface()

isAbstract

public final boolean isAbstract()

isClass

public boolean isClass()

isAspect

public boolean isAspect()

isAnnotationStyleAspect

public boolean isAnnotationStyleAspect()

isEnum

public boolean isEnum()
Note: Only overridden by Name subtype.


isAnnotation

public boolean isAnnotation()
Note: Only overridden by Name subtype.


isAnonymous

public boolean isAnonymous()

isNested

public boolean isNested()

getOuterClass

public ResolvedType getOuterClass()

addAnnotation

public void addAnnotation(AnnotationAJ annotationX)

getAnnotations

public AnnotationAJ[] getAnnotations()

canAnnotationTargetType

public boolean canAnnotationTargetType()
Note: Only overridden by ReferenceType subtype


getAnnotationTargetKinds

public AnnotationTargetKind[] getAnnotationTargetKinds()
Note: Only overridden by ReferenceType subtype


isAnnotationWithRuntimeRetention

public boolean isAnnotationWithRuntimeRetention()
Note: Only overridden by Name subtype.


isSynthetic

public boolean isSynthetic()

isFinal

public final boolean isFinal()

getMemberParameterizationMap

protected java.util.Map<java.lang.String,UnresolvedType> getMemberParameterizationMap()

getDeclaredAdvice

public java.util.List<ShadowMunger> getDeclaredAdvice()

getDeclaredShadowMungers

public java.util.List<ShadowMunger> getDeclaredShadowMungers()

getDeclaredJavaFields

public ResolvedMember[] getDeclaredJavaFields()

getDeclaredJavaMethods

public ResolvedMember[] getDeclaredJavaMethods()

getSourceContext

public abstract ISourceContext getSourceContext()

makeArray

public static ResolvedType makeArray(ResolvedType type,
                                     int dim)

lookupMemberNoSupers

public ResolvedMember lookupMemberNoSupers(Member member)
Look up a member, takes into account any ITDs on this type. return null if not found


lookupMemberWithSupersAndITDs

public ResolvedMember lookupMemberWithSupersAndITDs(Member member)

lookupDirectlyDeclaredMemberNoSupers

public ResolvedMember lookupDirectlyDeclaredMemberNoSupers(Member member)
as lookupMemberNoSupers, but does not include ITDs

Parameters:
member -
Returns:

lookupMemberIncludingITDsOnInterfaces

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

Parameters:
member -
Returns:

getInterTypeMungers

public java.util.List<ConcreteTypeMunger> getInterTypeMungers()

getInterTypeParentMungers

public java.util.List<ConcreteTypeMunger> getInterTypeParentMungers()

getInterTypeMungersIncludingSupers

public 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


getInterTypeParentMungersIncludingSupers

public java.util.List<ConcreteTypeMunger> getInterTypeParentMungersIncludingSupers()

collectInterTypeMungers

protected void collectInterTypeMungers(java.util.List<ConcreteTypeMunger> collector)

checkInterTypeMungers

public void checkInterTypeMungers()
Check: 1) That we don't have any abstract type mungers unless this type is abstract. 2) That an abstract ITDM on an interface is declared public. (Compiler limitation) (PR70794)


getDeclaringType

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

Warning: This is guaranteed to work for all member types. For anonymous/local types, the only guarantee is given in JLS 13.1, where it guarantees that if you call getDeclaringType() repeatedly, you will eventually get the top-level class, but it does not say anything about classes in between.

Returns:
the declaring type, or null if it is not an nested type.

isVisible

public static boolean isVisible(int modifiers,
                                ResolvedType targetType,
                                ResolvedType fromType)

discoverActualOccurrenceOfTypeInHierarchy

public ResolvedType discoverActualOccurrenceOfTypeInHierarchy(ResolvedType lookingFor)
Look up the actual occurence of a particular type in the hierarchy for 'this' type. The input is going to be a generic type, and the caller wants to know if it was used in its RAW or a PARAMETERIZED form in this hierarchy. returns null if it can't be found.


fillInAnyTypeParameters

public 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. When this happens this routine will check for the target type in the target hierarchy and 'bind' any type parameters as appropriate. For example, for the ITD "List I.x" against a type like this: "class A implements I" this routine will return a parameterized form of the ITD "List I.x"


addInterTypeMunger

public void addInterTypeMunger(ConcreteTypeMunger munger,
                               boolean isDuringCompilation)
Add an intertype munger to this type. isDuringCompilation tells us if we should be checking for an error scenario where two ITD fields are trying to use the same name. When this happens during compilation one of them is altered to get mangled name but when it happens during weaving it is too late and we need to put out an error asking them to recompile.


checkLegalOverride

public boolean checkLegalOverride(ResolvedMember parent,
                                  ResolvedMember child,
                                  int transformerPosition,
                                  ResolvedType aspectType)
Parameters:
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 transformer
Returns:
true if the override is legal note: calling showMessage with two locations issues TWO messages, not ONE message with an additional source location.

isMoreVisible

public static boolean isMoreVisible(int m1,
                                    int m2)

lookupSyntheticMember

public ResolvedMember lookupSyntheticMember(Member member)

clearInterTypeMungers

public void clearInterTypeMungers()

isTopmostImplementor

public boolean isTopmostImplementor(ResolvedType interfaceType)

getTopmostImplementor

public ResolvedType getTopmostImplementor(ResolvedType interfaceType)

getExposedPointcuts

public java.util.List<ResolvedMember> getExposedPointcuts()

getSourceLocation

public ISourceLocation getSourceLocation()

isExposedToWeaver

public boolean isExposedToWeaver()

getWeaverState

public WeaverStateInfo getWeaverState()

getGenericType

public ReferenceType getGenericType()
Overridden by ReferenceType to return a sensible answer for parameterized and raw types.

Returns:

getRawType

public ResolvedType getRawType()
Overrides:
getRawType in class UnresolvedType

parameterizedWith

public ResolvedType parameterizedWith(UnresolvedType[] typeParameters)

parameterize

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

Overrides:
parameterize in class UnresolvedType

isException

public boolean isException()
Returns:
true if assignable to java.lang.Exception

isCheckedException

public boolean isCheckedException()
Returns:
true if it is an exception and it is a checked one, false otherwise.

isConvertableFrom

public final boolean isConvertableFrom(ResolvedType other)
Determines if variables of this type could be assigned values of another with lots of help. java.lang.Object is convertable from all types. A primitive type is convertable from X iff it's assignable from X. A reference type is convertable from X iff it's coerceable from X. In other words, X isConvertableFrom Y iff the compiler thinks that _some_ value of Y could be assignable to a variable of type X without loss of precision.

Parameters:
other - the other type
world - the World in which the possible assignment should be checked.
Returns:
true iff variables of this type could be assigned values of other with possible conversion

isAssignableFrom

public abstract boolean isAssignableFrom(ResolvedType other)
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 - the other type
world - the World in which the possible assignment should be checked.
Returns:
true iff variables of this type could be assigned values of other without casting
Throws:
java.lang.NullPointerException - if other is null

isAssignableFrom

public abstract boolean isAssignableFrom(ResolvedType other,
                                         boolean allowMissing)

isCoerceableFrom

public abstract boolean isCoerceableFrom(ResolvedType other)
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:
other - the other type
world - the World in which the possible coersion should be checked.
Returns:
true iff values of other could possibly be cast to this type.
Throws:
java.lang.NullPointerException - if other is null.

needsNoConversionFrom

public boolean needsNoConversionFrom(ResolvedType o)

getSignatureForAttribute

public java.lang.String getSignatureForAttribute()

isParameterizedWithTypeVariable

public boolean isParameterizedWithTypeVariable()
return true if the parameterization of this type includes a member type variable. Member type variables occur in generic methods/ctors.


ajMembersNeedParameterization

protected boolean ajMembersNeedParameterization()

getAjMemberParameterizationMap

protected java.util.Map<java.lang.String,UnresolvedType> getAjMemberParameterizationMap()

setBinaryPath

public void setBinaryPath(java.lang.String binaryPath)

getBinaryPath

public 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


ensureConsistent

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


isInheritedAnnotation

public boolean isInheritedAnnotation()
For an annotation type, this will return if it is marked with @Inherited


tagAsTypeHierarchyComplete

public void tagAsTypeHierarchyComplete()

isTypeHierarchyComplete

public boolean isTypeHierarchyComplete()

getCompilerVersion

public int getCompilerVersion()
return the weaver version used to build this type - defaults to the most recent version unless discovered otherwise.

Returns:
the (major) version, AjAttribute.WeaverVersionInfo

isPrimitiveArray

public boolean isPrimitiveArray()

isGroovyObject

public boolean isGroovyObject()