Package org.aspectj.weaver.reflect
Class ReflectionBasedReferenceTypeDelegate
java.lang.Object
org.aspectj.weaver.reflect.ReflectionBasedReferenceTypeDelegate
- All Implemented Interfaces:
ReferenceTypeDelegate
- Direct Known Subclasses:
Java15ReflectionBasedReferenceTypeDelegate
- 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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected WeakClassLoaderReferenceprotected Classprotected World -
Constructor Summary
ConstructorsConstructorDescriptionfor reflective construction onlyReflectionBasedReferenceTypeDelegate(Class forClass, ClassLoader aClassLoader, World inWorld, ReferenceType resolvedType) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancreateResolvedMemberFor(Member aMember) booleanvoidImplementations need to clear stateprotected ClassClass<?>getClazz()intIf known, return the compiler/weaver version used to build this delegate.intprotected WorldgetWorld()booleanhasAnnotation(UnresolvedType ofType) booleanbooleanvoidinitialize(ReferenceType aType, Class<?> aClass, ClassLoader aClassLoader, World aWorld) booleanbooleanbooleanbooleanbooleanisAspect()booleanTODO Caching of methods besides getDeclaredInterfaces() may also be dependent on this flag - which?booleanisClass()booleanisEnum()booleanbooleanbooleanbooleanisNested()boolean
-
Field Details
-
myClass
-
classLoaderReference
-
world
-
-
Constructor Details
-
ReflectionBasedReferenceTypeDelegate
public ReflectionBasedReferenceTypeDelegate(Class forClass, ClassLoader aClassLoader, World inWorld, ReferenceType resolvedType) -
ReflectionBasedReferenceTypeDelegate
public ReflectionBasedReferenceTypeDelegate()for reflective construction only
-
-
Method Details
-
initialize
public void initialize(ReferenceType aType, Class<?> aClass, ClassLoader aClassLoader, World aWorld) -
getClazz
-
getBaseClass
-
getWorld
-
buildGenericType
-
isAspect
public boolean isAspect()- Specified by:
isAspectin interfaceReferenceTypeDelegate
-
isAnnotationStyleAspect
public boolean isAnnotationStyleAspect()- Specified by:
isAnnotationStyleAspectin interfaceReferenceTypeDelegate- Returns:
- true if the type is an annotation style aspect (a type marked @Aspect)
-
isInterface
public boolean isInterface()- Specified by:
isInterfacein interfaceReferenceTypeDelegate
-
isEnum
public boolean isEnum()- Specified by:
isEnumin interfaceReferenceTypeDelegate
-
isAnnotationWithRuntimeRetention
public boolean isAnnotationWithRuntimeRetention()- Specified by:
isAnnotationWithRuntimeRetentionin interfaceReferenceTypeDelegate- Returns:
- true if this annotation type has a retention policy of RUNTIME
-
isAnnotation
public boolean isAnnotation()- Specified by:
isAnnotationin interfaceReferenceTypeDelegate
-
getRetentionPolicy
- Specified by:
getRetentionPolicyin interfaceReferenceTypeDelegate
-
canAnnotationTargetType
public boolean canAnnotationTargetType()- Specified by:
canAnnotationTargetTypein interfaceReferenceTypeDelegate- Returns:
- true if this annotation type can be on a regular type (ie. it doesn't specify anything or it specifies TYPE)
-
getAnnotationTargetKinds
- Specified by:
getAnnotationTargetKindsin interfaceReferenceTypeDelegate- Returns:
- all the possible targets that this annotation can be placed upon
-
isClass
public boolean isClass()- Specified by:
isClassin interfaceReferenceTypeDelegate
-
isGeneric
public boolean isGeneric()- Specified by:
isGenericin interfaceReferenceTypeDelegate
-
isAnonymous
public boolean isAnonymous()- Specified by:
isAnonymousin interfaceReferenceTypeDelegate
-
isNested
public boolean isNested()- Specified by:
isNestedin interfaceReferenceTypeDelegate- Returns:
- true if this class is nested (this includes: member classes, local classes, anonymous classes)
-
getOuterClass
- Specified by:
getOuterClassin interfaceReferenceTypeDelegate
-
isExposedToWeaver
public boolean isExposedToWeaver()- Specified by:
isExposedToWeaverin interfaceReferenceTypeDelegate
-
hasAnnotation
- Specified by:
hasAnnotationin interfaceReferenceTypeDelegate
-
getAnnotations
- Specified by:
getAnnotationsin interfaceReferenceTypeDelegate
-
hasAnnotations
public boolean hasAnnotations()- Specified by:
hasAnnotationsin interfaceReferenceTypeDelegate
-
getAnnotationTypes
- Specified by:
getAnnotationTypesin interfaceReferenceTypeDelegate
-
getDeclaredFields
- Specified by:
getDeclaredFieldsin interfaceReferenceTypeDelegate
-
getDeclaredInterfaces
- Specified by:
getDeclaredInterfacesin interfaceReferenceTypeDelegate
-
isCacheable
public boolean isCacheable()Description copied from interface:ReferenceTypeDelegateTODO Caching of methods besides getDeclaredInterfaces() may also be dependent on this flag - which?- Specified by:
isCacheablein interfaceReferenceTypeDelegate- Returns:
- true if something the result of getDeclaredInterfaces() can be cached by the caller
-
getDeclaredMethods
- Specified by:
getDeclaredMethodsin interfaceReferenceTypeDelegate
-
getDeclaredPointcuts
- Specified by:
getDeclaredPointcutsin interfaceReferenceTypeDelegate
-
getTypeVariables
- Specified by:
getTypeVariablesin interfaceReferenceTypeDelegate
-
getPerClause
- Specified by:
getPerClausein interfaceReferenceTypeDelegate- Returns:
- for an aspect declaration, return the
-
getDeclares
- Specified by:
getDeclaresin interfaceReferenceTypeDelegate
-
getTypeMungers
- Specified by:
getTypeMungersin interfaceReferenceTypeDelegate
-
getPrivilegedAccesses
- Specified by:
getPrivilegedAccessesin interfaceReferenceTypeDelegate
-
getModifiers
public int getModifiers()- Specified by:
getModifiersin interfaceReferenceTypeDelegate
-
getSuperclass
- Specified by:
getSuperclassin interfaceReferenceTypeDelegate
-
getWeaverState
- Specified by:
getWeaverStatein interfaceReferenceTypeDelegate
-
getResolvedTypeX
- Specified by:
getResolvedTypeXin interfaceReferenceTypeDelegate
-
doesNotExposeShadowMungers
public boolean doesNotExposeShadowMungers()- Specified by:
doesNotExposeShadowMungersin interfaceReferenceTypeDelegate
-
getDeclaredGenericSignature
- Specified by:
getDeclaredGenericSignaturein interfaceReferenceTypeDelegate
-
createResolvedMemberFor
-
getSourcefilename
- Specified by:
getSourcefilenamein interfaceReferenceTypeDelegate
-
getSourceContext
- Specified by:
getSourceContextin interfaceReferenceTypeDelegate
-
copySourceContext
public boolean copySourceContext()- Specified by:
copySourceContextin interfaceReferenceTypeDelegate
-
getCompilerVersion
public int getCompilerVersion()Description copied from interface:ReferenceTypeDelegateIf known, return the compiler/weaver version used to build this delegate. Default is the most recent level as specified inAjAttribute.WeaverVersionInfo.- Specified by:
getCompilerVersionin interfaceReferenceTypeDelegate- Returns:
- the major version
-
ensureConsistent
public void ensureConsistent()Description copied from interface:ReferenceTypeDelegateImplementations need to clear state- Specified by:
ensureConsistentin interfaceReferenceTypeDelegate
-
isWeavable
public boolean isWeavable()- Specified by:
isWeavablein interfaceReferenceTypeDelegate
-
hasBeenWoven
public boolean hasBeenWoven()- Specified by:
hasBeenWovenin interfaceReferenceTypeDelegate
-