Klasse ResolvedType

java.lang.Object
org.aspectj.weaver.UnresolvedType
org.aspectj.weaver.ResolvedType
Alle implementierten Schnittstellen:
AnnotatedElement, Traceable, TypeVariableDeclaringElement
Bekannte direkte Unterklassen:
MissingResolvedTypeWithKnownSignature, ReferenceType

public abstract class ResolvedType extends UnresolvedType implements AnnotatedElement
  • Felddetails

    • EMPTY_RESOLVED_TYPE_ARRAY

      public static final ResolvedType[] EMPTY_RESOLVED_TYPE_ARRAY
    • PARAMETERIZED_TYPE_IDENTIFIER

      public static final String PARAMETERIZED_TYPE_IDENTIFIER
      Siehe auch:
    • temporaryAnnotationTypes

      public ResolvedType[] temporaryAnnotationTypes
    • world

      protected World world
    • bits

      protected int bits
    • validBoxing

      protected static Set<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 List<ConcreteTypeMunger> interTypeMungers
  • Konstruktordetails

    • ResolvedType

      protected ResolvedType(String signature, World world)
    • ResolvedType

      protected ResolvedType(String signature, String signatureErasure, World world)
  • Methodendetails

    • getSize

      public int getSize()
      Beschreibung aus Klasse kopiert: UnresolvedType
      This is the size of this type as used in JVM.
      Setzt außer Kraft:
      getSize in Klasse UnresolvedType
    • getDirectSupertypes

      public final 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()
      Gibt zurück:
      the superclass of this type, or null (if this represents a jlObject, primitive, or void)
    • getModifiers

      public abstract int getModifiers()
    • canBeSeenBy

      public boolean canBeSeenBy(ResolvedType from)
    • isMissing

      public boolean isMissing()
    • isMissing

      public static boolean isMissing(UnresolvedType unresolved)
    • getAnnotationTypes

      public ResolvedType[] getAnnotationTypes()
      Angegeben von:
      getAnnotationTypes in Schnittstelle AnnotatedElement
    • getAnnotationOfType

      public AnnotationAJ getAnnotationOfType(UnresolvedType ofType)
      Angegeben von:
      getAnnotationOfType in Schnittstelle AnnotatedElement
    • getResolvedComponentType

      public ResolvedType getResolvedComponentType()
    • getWorld

      public World getWorld()
    • equals

      public boolean equals(Object other)
      Beschreibung aus Klasse kopiert: UnresolvedType
      Equality is checked based on the underlying signature.
      Setzt außer Kraft:
      equals in Klasse UnresolvedType
    • getFields

      public 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
      • fields from current class
      • recur into direct superinterfaces
      • recur into superclass

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

    • getMethods

      public 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
      • methods from current class
      • recur into superclass, all the way up, not touching interfaces
      • recur into all superinterfaces, in some unspecified order (but those 'closest' to this type are first)
      Parameter:
      wantGenerics - is true if the caller would like all generics information, otherwise those methods are collapsed to their erasure
    • getMethodsIncludingIntertypeDeclarations

      public Iterator<ResolvedMember> getMethodsIncludingIntertypeDeclarations(boolean wantGenerics, boolean wantDeclaredParents)
    • getHierarchy

      public 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).
      Gibt zurück:
      an iterator over all types in the hierarchy of this type
    • getHierarchy

      public Iterator<ResolvedType> getHierarchy(boolean wantGenerics, boolean wantDeclaredParents)
      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).
      Parameter:
      wantGenerics - true if the caller wants full generic information
      wantDeclaredParents - true if the caller even wants those parents introduced via declare parents
      Gibt zurück:
      an iterator over all types in the hierarchy of this type
    • getMethodsWithoutIterator

      public 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 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.
      Parameter:
      genericsAware - should the list include parameterized/generic types (if not, they will be collapsed to raw)?
      Gibt zurück:
      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)
      Parameter:
      member - the member to lookup in intertype declarations affecting this type
      Gibt zurück:
      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 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
      • pointcuts from current class
      • recur into direct superinterfaces
      • recur into superclass

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

    • findPointcut

      public ResolvedPointcutDefinition findPointcut(String name)
    • collectCrosscuttingMembers

      public CrosscuttingMembers collectCrosscuttingMembers(boolean shouldConcretizeIfNeeded)
    • collectDeclares

      public final List<Declare> collectDeclares(boolean includeAdviceLike)
    • addParent

      public void addParent(ResolvedType newParent)
    • doesNotExposeShadowMungers

      protected boolean doesNotExposeShadowMungers()
    • getPerClause

      public PerClause getPerClause()
    • getDeclares

      public Collection<Declare> getDeclares()
    • getTypeMungers

      public Collection<ConcreteTypeMunger> getTypeMungers()
    • getPrivilegedAccesses

      public 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()
    • hasAnnotations

      public boolean hasAnnotations()
    • 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 Map<String,UnresolvedType> getMemberParameterizationMap()
    • getDeclaredAdvice

      public List<ShadowMunger> getDeclaredAdvice()
    • getDeclaredShadowMungers

      public 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
      Parameter:
      member -
      Gibt zurück:
    • 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.
      Parameter:
      member -
      Gibt zurück:
    • getInterTypeMungers

      public List<ConcreteTypeMunger> getInterTypeMungers()
    • getInterTypeParentMungers

      public List<ConcreteTypeMunger> getInterTypeParentMungers()
    • getInterTypeMungersIncludingSupers

      public 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 List<ConcreteTypeMunger> getInterTypeParentMungersIncludingSupers()
    • collectInterTypeMungers

      protected void collectInterTypeMungers(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.

      Gibt zurück:
      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<T> I<T>.x" against a type like this: "class A implements I<String>" this routine will return a parameterized form of the ITD "List<String> 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)
      Parameter:
      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
      Gibt zurück:
      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 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.
      Gibt zurück:
    • getRawType

      public ResolvedType getRawType()
      Setzt außer Kraft:
      getRawType in Klasse UnresolvedType
    • parameterizedWith

      public ResolvedType parameterizedWith(UnresolvedType[] typeParameters)
    • parameterize

      public UnresolvedType parameterize(Map<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.
      Setzt außer Kraft:
      parameterize in Klasse UnresolvedType
    • isException

      public boolean isException()
      Gibt zurück:
      true if assignable to java.lang.Exception
    • isCheckedException

      public boolean isCheckedException()
      Gibt zurück:
      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.
      Parameter:
      other - the other type
      Gibt zurück:
      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).
      Parameter:
      other - the other type
      Gibt zurück:
      true iff variables of this type could be assigned values of other without casting
      Löst aus:
      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)
       
      Parameter:
      other - the other type
      Gibt zurück:
      true iff values of other could possibly be cast to this type.
      Löst aus:
      NullPointerException - if other is null.
    • needsNoConversionFrom

      public boolean needsNoConversionFrom(ResolvedType o)
    • getSignatureForAttribute

      public 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 Map<String,UnresolvedType> getAjMemberParameterizationMap()
    • setBinaryPath

      public void setBinaryPath(String binaryPath)
    • getBinaryPath

      public 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.
      Gibt zurück:
      the (major) version, AjAttribute.WeaverVersionInfo
    • isPrimitiveArray

      public boolean isPrimitiveArray()
    • isGroovyObject

      public boolean isGroovyObject()
    • isPrivilegedAspect

      public boolean isPrivilegedAspect()