public abstract class

AbstractAspectJAdvisorFactory

extends Object
implements AspectJAdvisorFactory
java.lang.Object
   ↳ org.springframework.aop.aspectj.annotation.AbstractAspectJAdvisorFactory
Known Direct Subclasses

Class Overview

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.

Summary

Nested Classes
class AbstractAspectJAdvisorFactory.AspectJAnnotation<A extends Annotation> Class modelling an AspectJ annotation, exposing its type enumeration and pointcut String. 
enum AbstractAspectJAdvisorFactory.AspectJAnnotationType  
Fields
protected static final ParameterNameDiscoverer ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER
protected final Log logger Logger available to subclasses
protected final ParameterNameDiscoverer parameterNameDiscoverer
Protected Constructors
AbstractAspectJAdvisorFactory()
Public Methods
boolean isAspect(Class<?> clazz)
We consider something to be an AspectJ aspect suitable for use by the Spring AOP system if it has the @Aspect annotation, and was not compiled by ajc.
void validate(Class<?> aspectClass)
Is the given class a valid AspectJ aspect class?
Protected Methods
AspectJExpressionPointcut createPointcutExpression(Method annotatedMethod, Class declarationScope, String[] pointcutParameterNames)
The pointcut and advice annotations both have an "argNames" member which contains a comma-separated list of the argument names.
static AspectJAnnotation findAspectJAnnotationOnMethod(Method method)
Find and return the first AspectJ annotation on the given method (there should only be one anyway...)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory

Fields

protected static final ParameterNameDiscoverer ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER

protected final Log logger

Logger available to subclasses

protected final ParameterNameDiscoverer parameterNameDiscoverer

Protected Constructors

protected AbstractAspectJAdvisorFactory ()

Public Methods

public boolean isAspect (Class<?> clazz)

We consider something to be an AspectJ aspect suitable for use by the Spring AOP system if it has the @Aspect annotation, and was not compiled by ajc. The reason for this latter test is that aspects written in the code-style (AspectJ language) also have the annotation present when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP.

Parameters
clazz the supposed annotation-style AspectJ class
Returns
  • whether or not this class is recognized by AspectJ as an aspect class

public void validate (Class<?> aspectClass)

Is the given class a valid AspectJ aspect class?

Parameters
aspectClass the supposed AspectJ annotation-style class to validate

Protected Methods

protected AspectJExpressionPointcut createPointcutExpression (Method annotatedMethod, Class declarationScope, String[] pointcutParameterNames)

The pointcut and advice annotations both have an "argNames" member which contains a comma-separated list of the argument names. We use this (if non-empty) to build the formal parameters for the pointcut.

protected static AspectJAnnotation findAspectJAnnotationOnMethod (Method method)

Find and return the first AspectJ annotation on the given method (there should only be one anyway...)