org.aspectj.weaver.reflect
Class ReflectionBasedReferenceTypeDelegate
java.lang.Object
org.aspectj.weaver.reflect.ReflectionBasedReferenceTypeDelegate
- All Implemented Interfaces:
- ReferenceTypeDelegate
- Direct Known Subclasses:
- Java15ReflectionBasedReferenceTypeDelegate
public class ReflectionBasedReferenceTypeDelegate
- extends java.lang.Object
- implements ReferenceTypeDelegate
- Author:
- colyer A delegate for a resolved type that uses runtime type information (java.lang.reflect) to answer questions. This
class uses only Java 1.4 features to answer questions. In a Java 1.5 environment use the
Java5ReflectionBasedReferenceTypeDelegate subtype.
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionBasedReferenceTypeDelegate
public ReflectionBasedReferenceTypeDelegate(java.lang.Class forClass,
java.lang.ClassLoader aClassLoader,
World inWorld,
ReferenceType resolvedType)
ReflectionBasedReferenceTypeDelegate
public ReflectionBasedReferenceTypeDelegate()
- for reflective construction only
initialize
public void initialize(ReferenceType aType,
java.lang.Class aClass,
java.lang.ClassLoader aClassLoader,
World aWorld)
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