Class AbstractAspectJAdvisorFactory
java.lang.Object
org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
- All Implemented Interfaces:
AspectJAdvisorFactory
- Direct Known Subclasses:
ReflectiveAspectJAdvisorFactory
Abstract base class for factories that can create Spring AOP Advisors
given AspectJ classes from classes honoring the AspectJ 5 annotation syntax.
This class handles annotation parsing and validation functionality. It does not actually generate Spring AOP Advisors, which is deferred to subclasses.
- Since:
- 2.0
- Author:
- Rod Johnson, Adrian Colyer, Juergen Hoeller, Sam Brannen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classClass modeling an AspectJ annotation, exposing its type enumeration and pointcut String.protected static enumEnum for AspectJ annotation types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LogLogger available to subclasses.protected final ParameterNameDiscoverer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static AbstractAspectJAdvisorFactory.AspectJAnnotationfindAspectJAnnotationOnMethod(Method method) Find and return the first AspectJ annotation on the given method (there should only be one anyway...).booleanDetermine whether the given class is an aspect, as reported by AspectJ'sAjTypeSystem.voidIs the given class a valid AspectJ aspect class?Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
getAdvice, getAdvisor, getAdvisors
-
Field Details
-
logger
Logger available to subclasses. -
parameterNameDiscoverer
-
-
Constructor Details
-
AbstractAspectJAdvisorFactory
public AbstractAspectJAdvisorFactory()
-
-
Method Details
-
isAspect
Description copied from interface:AspectJAdvisorFactoryDetermine whether the given class is an aspect, as reported by AspectJ'sAjTypeSystem.Will simply return
falseif the supposed aspect is invalid (such as an extension of a concrete aspect class). Will return true for some aspects that Spring AOP cannot process, such as those with unsupported instantiation models. Use theAspectJAdvisorFactory.validate(java.lang.Class<?>)method to handle these cases if necessary.- Specified by:
isAspectin interfaceAspectJAdvisorFactory- Parameters:
clazz- the supposed annotation-style AspectJ class- Returns:
- whether this class is recognized by AspectJ as an aspect class
-
validate
Description copied from interface:AspectJAdvisorFactoryIs the given class a valid AspectJ aspect class?- Specified by:
validatein interfaceAspectJAdvisorFactory- Parameters:
aspectClass- the supposed AspectJ annotation-style class to validate- Throws:
AopConfigException- if the class is an invalid aspect (which can never be legal)NotAnAtAspectException- if the class is not an aspect at all (which may or may not be legal, depending on the context)
-
findAspectJAnnotationOnMethod
@Nullable protected static AbstractAspectJAdvisorFactory.AspectJAnnotation findAspectJAnnotationOnMethod(Method method) Find and return the first AspectJ annotation on the given method (there should only be one anyway...).
-