org.aspectj.weaver.reflect
Class ReflectionBasedReferenceTypeDelegate

java.lang.Object
  extended by org.aspectj.weaver.reflect.ReflectionBasedReferenceTypeDelegate
All Implemented Interfaces:
ReferenceTypeDelegate
Direct Known Subclasses:
Java15ReflectionBasedReferenceTypeDelegate

public class ReflectionBasedReferenceTypeDelegate
extends java.lang.Object
implements ReferenceTypeDelegate


Field Summary
protected  WeakClassLoaderReference classLoaderReference
           
protected  java.lang.Class myClass
           
protected  World world
           
 
Constructor Summary
ReflectionBasedReferenceTypeDelegate()
          for reflective construction only
ReflectionBasedReferenceTypeDelegate(java.lang.Class forClass, java.lang.ClassLoader aClassLoader, World inWorld, ReferenceType resolvedType)
           
 
Method Summary
 ReferenceType buildGenericType()
           
 boolean canAnnotationTargetType()
           
 boolean copySourceContext()
           
 ReflectionBasedResolvedMemberImpl createResolvedMemberFor(java.lang.reflect.Member aMember)
           
 boolean doesNotExposeShadowMungers()
           
 void ensureConsistent()
          Implementations need to clear state
 AnnotationAJ[] getAnnotations()
           
 AnnotationTargetKind[] getAnnotationTargetKinds()
           
 ResolvedType[] getAnnotationTypes()
           
protected  java.lang.Class getBaseClass()
           
 int getCompilerVersion()
          If known, return the compiler/weaver version used to build this delegate.
 ResolvedMember[] getDeclaredFields()
           
 java.lang.String getDeclaredGenericSignature()
           
 ResolvedType[] getDeclaredInterfaces()
           
 ResolvedMember[] getDeclaredMethods()
           
 ResolvedMember[] getDeclaredPointcuts()
           
 java.util.Collection getDeclares()
           
 int getModifiers()
           
 ResolvedType getOuterClass()
           
 PerClause getPerClause()
           
 java.util.Collection getPrivilegedAccesses()
           
 ReferenceType getResolvedTypeX()
           
 java.lang.String getRetentionPolicy()
           
 ISourceContext getSourceContext()
           
 java.lang.String getSourcefilename()
           
 ResolvedType getSuperclass()
           
 java.util.Collection getTypeMungers()
           
 TypeVariable[] getTypeVariables()
           
 WeaverStateInfo getWeaverState()
           
protected  World getWorld()
           
 boolean hasAnnotation(UnresolvedType ofType)
           
 boolean hasBeenWoven()
           
 void initialize(ReferenceType aType, java.lang.Class aClass, java.lang.ClassLoader aClassLoader, World aWorld)
           
 boolean isAnnotation()
           
 boolean isAnnotationStyleAspect()
           
 boolean isAnnotationWithRuntimeRetention()
           
 boolean isAnonymous()
           
 boolean isAspect()
           
 boolean isCacheable()
          TODO Caching of methods besides getDeclaredInterfaces() may also be dependent on this flag - which?
 boolean isClass()
           
 boolean isEnum()
           
 boolean isExposedToWeaver()
           
 boolean isGeneric()
           
 boolean isInterface()
           
 boolean isNested()
           
 boolean isWeavable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myClass

protected java.lang.Class myClass

classLoaderReference

protected WeakClassLoaderReference classLoaderReference

world

protected World world
Constructor Detail

ReflectionBasedReferenceTypeDelegate

public ReflectionBasedReferenceTypeDelegate(java.lang.Class forClass,
                                            java.lang.ClassLoader aClassLoader,
                                            World inWorld,
                                            ReferenceType resolvedType)

ReflectionBasedReferenceTypeDelegate

public ReflectionBasedReferenceTypeDelegate()
for reflective construction only

Method Detail

initialize

public void initialize(ReferenceType aType,
                       java.lang.Class aClass,
                       java.lang.ClassLoader aClassLoader,
                       World aWorld)

getBaseClass

protected java.lang.Class getBaseClass()

getWorld

protected World getWorld()

buildGenericType

public ReferenceType buildGenericType()

isAspect

public boolean isAspect()
Specified by:
isAspect in interface ReferenceTypeDelegate

isAnnotationStyleAspect

public boolean isAnnotationStyleAspect()
Specified by:
isAnnotationStyleAspect in interface ReferenceTypeDelegate
Returns:
true if the type is an annotation style aspect (a type marked @Aspect)

isInterface

public boolean isInterface()
Specified by:
isInterface in interface ReferenceTypeDelegate

isEnum

public boolean isEnum()
Specified by:
isEnum in interface ReferenceTypeDelegate

isAnnotationWithRuntimeRetention

public boolean isAnnotationWithRuntimeRetention()
Specified by:
isAnnotationWithRuntimeRetention in interface ReferenceTypeDelegate
Returns:
true if this annotation type has a retention policy of RUNTIME

isAnnotation

public boolean isAnnotation()
Specified by:
isAnnotation in interface ReferenceTypeDelegate

getRetentionPolicy

public java.lang.String getRetentionPolicy()
Specified by:
getRetentionPolicy in interface ReferenceTypeDelegate

canAnnotationTargetType

public boolean canAnnotationTargetType()
Specified by:
canAnnotationTargetType in interface ReferenceTypeDelegate
Returns:
true if this annotation type can be on a regular type (ie. it doesn't specify anything or it specifies TYPE)

getAnnotationTargetKinds

public AnnotationTargetKind[] getAnnotationTargetKinds()
Specified by:
getAnnotationTargetKinds in interface ReferenceTypeDelegate
Returns:
all the possible targets that this annotation can be placed upon

isClass

public boolean isClass()
Specified by:
isClass in interface ReferenceTypeDelegate

isGeneric

public boolean isGeneric()
Specified by:
isGeneric in interface ReferenceTypeDelegate

isAnonymous

public boolean isAnonymous()
Specified by:
isAnonymous in interface ReferenceTypeDelegate

isNested

public boolean isNested()
Specified by:
isNested in interface ReferenceTypeDelegate
Returns:
true if this class is nested (this includes: member classes, local classes, anonymous classes)

getOuterClass

public ResolvedType getOuterClass()
Specified by:
getOuterClass in interface ReferenceTypeDelegate

isExposedToWeaver

public boolean isExposedToWeaver()
Specified by:
isExposedToWeaver in interface ReferenceTypeDelegate

hasAnnotation

public boolean hasAnnotation(UnresolvedType ofType)
Specified by:
hasAnnotation in interface ReferenceTypeDelegate

getAnnotations

public AnnotationAJ[] getAnnotations()
Specified by:
getAnnotations in interface ReferenceTypeDelegate

getAnnotationTypes

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

getDeclaredFields

public ResolvedMember[] getDeclaredFields()
Specified by:
getDeclaredFields in interface ReferenceTypeDelegate

getDeclaredInterfaces

public ResolvedType[] getDeclaredInterfaces()
Specified by:
getDeclaredInterfaces in interface ReferenceTypeDelegate

isCacheable

public boolean isCacheable()
Description copied from interface: ReferenceTypeDelegate
TODO Caching of methods besides getDeclaredInterfaces() may also be dependent on this flag - which?

Specified by:
isCacheable in interface ReferenceTypeDelegate
Returns:
true if something the result of getDeclaredInterfaces() can be cached by the caller

getDeclaredMethods

public ResolvedMember[] getDeclaredMethods()
Specified by:
getDeclaredMethods in interface ReferenceTypeDelegate

getDeclaredPointcuts

public ResolvedMember[] getDeclaredPointcuts()
Specified by:
getDeclaredPointcuts in interface ReferenceTypeDelegate

getTypeVariables

public TypeVariable[] getTypeVariables()
Specified by:
getTypeVariables in interface ReferenceTypeDelegate

getPerClause

public PerClause getPerClause()
Specified by:
getPerClause in interface ReferenceTypeDelegate
Returns:
for an aspect declaration, return the

getDeclares

public java.util.Collection getDeclares()
Specified by:
getDeclares in interface ReferenceTypeDelegate

getTypeMungers

public java.util.Collection getTypeMungers()
Specified by:
getTypeMungers in interface ReferenceTypeDelegate

getPrivilegedAccesses

public java.util.Collection getPrivilegedAccesses()
Specified by:
getPrivilegedAccesses in interface ReferenceTypeDelegate

getModifiers

public int getModifiers()
Specified by:
getModifiers in interface ReferenceTypeDelegate

getSuperclass

public ResolvedType getSuperclass()
Specified by:
getSuperclass in interface ReferenceTypeDelegate

getWeaverState

public WeaverStateInfo getWeaverState()
Specified by:
getWeaverState in interface ReferenceTypeDelegate

getResolvedTypeX

public ReferenceType getResolvedTypeX()
Specified by:
getResolvedTypeX in interface ReferenceTypeDelegate

doesNotExposeShadowMungers

public boolean doesNotExposeShadowMungers()
Specified by:
doesNotExposeShadowMungers in interface ReferenceTypeDelegate

getDeclaredGenericSignature

public java.lang.String getDeclaredGenericSignature()
Specified by:
getDeclaredGenericSignature in interface ReferenceTypeDelegate

createResolvedMemberFor

public ReflectionBasedResolvedMemberImpl createResolvedMemberFor(java.lang.reflect.Member aMember)

getSourcefilename

public java.lang.String getSourcefilename()
Specified by:
getSourcefilename in interface ReferenceTypeDelegate

getSourceContext

public ISourceContext getSourceContext()
Specified by:
getSourceContext in interface ReferenceTypeDelegate

copySourceContext

public boolean copySourceContext()
Specified by:
copySourceContext in interface ReferenceTypeDelegate

getCompilerVersion

public int getCompilerVersion()
Description copied from interface: ReferenceTypeDelegate
If known, return the compiler/weaver version used to build this delegate. Default is the most recent level as specified in AjAttribute.WeaverVersionInfo.

Specified by:
getCompilerVersion in interface ReferenceTypeDelegate
Returns:
the major version

ensureConsistent

public void ensureConsistent()
Description copied from interface: ReferenceTypeDelegate
Implementations need to clear state

Specified by:
ensureConsistent in interface ReferenceTypeDelegate

isWeavable

public boolean isWeavable()
Specified by:
isWeavable in interface ReferenceTypeDelegate

hasBeenWoven

public boolean hasBeenWoven()
Specified by:
hasBeenWoven in interface ReferenceTypeDelegate