public class AspectJExpressionPointcut extends AbstractExpressionPointcut implements ClassFilter, IntroductionAwareMethodMatcher, org.springframework.beans.factory.BeanFactoryAware
Pointcut implementation
that uses the AspectJ weaver to evaluate a pointcut expression.
The pointcut expression value is an AspectJ expression. This can reference other pointcuts and use composition and other operations.
Naturally, as this is to be processed by Spring AOP's proxy-based model, only method execution pointcuts are supported.
TRUE| Constructor and Description |
|---|
AspectJExpressionPointcut()
Create a new default AspectJExpressionPointcut.
|
AspectJExpressionPointcut(java.lang.Class<?> declarationScope,
java.lang.String[] paramNames,
java.lang.Class<?>[] paramTypes)
Create a new AspectJExpressionPointcut with the given settings.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object other) |
ClassFilter |
getClassFilter()
Return the ClassFilter for this pointcut.
|
protected java.lang.String |
getCurrentProxiedBeanName() |
MethodMatcher |
getMethodMatcher()
Return the MethodMatcher for this pointcut.
|
org.aspectj.weaver.tools.PointcutExpression |
getPointcutExpression()
Return the underlying AspectJ pointcut expression.
|
int |
hashCode() |
boolean |
isRuntime()
Is this MethodMatcher dynamic, that is, must a final call be made on the
MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at
runtime even if the 2-arg matches method returns true? |
boolean |
matches(java.lang.Class<?> targetClass)
Should the pointcut apply to the given interface or target class?
|
boolean |
matches(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
Perform static checking whether the given method matches.
|
boolean |
matches(java.lang.reflect.Method method,
java.lang.Class<?> targetClass,
boolean beanHasIntroductions)
Perform static checking whether the given method matches.
|
boolean |
matches(java.lang.reflect.Method method,
java.lang.Class<?> targetClass,
java.lang.Object... args)
Check whether there a runtime (dynamic) match for this method,
which must have matched statically.
|
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setParameterNames(java.lang.String... names)
Set the parameter names for the pointcut.
|
void |
setParameterTypes(java.lang.Class<?>... types)
Set the parameter types for the pointcut.
|
void |
setPointcutDeclarationScope(java.lang.Class<?> pointcutDeclarationScope)
Set the declaration scope for the pointcut.
|
java.lang.String |
toString() |
getExpression, getLocation, onSetExpression, setExpression, setLocationpublic AspectJExpressionPointcut()
public AspectJExpressionPointcut(java.lang.Class<?> declarationScope,
java.lang.String[] paramNames,
java.lang.Class<?>[] paramTypes)
declarationScope - the declaration scope for the pointcutparamNames - the parameter names for the pointcutparamTypes - the parameter types for the pointcutpublic void setPointcutDeclarationScope(java.lang.Class<?> pointcutDeclarationScope)
public void setParameterNames(java.lang.String... names)
public void setParameterTypes(java.lang.Class<?>... types)
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAwarepublic ClassFilter getClassFilter()
PointcutgetClassFilter in interface Pointcutnull)public MethodMatcher getMethodMatcher()
PointcutgetMethodMatcher in interface Pointcutnull)public org.aspectj.weaver.tools.PointcutExpression getPointcutExpression()
public boolean matches(java.lang.Class<?> targetClass)
ClassFiltermatches in interface ClassFiltertargetClass - the candidate target classpublic boolean matches(java.lang.reflect.Method method,
java.lang.Class<?> targetClass,
boolean beanHasIntroductions)
IntroductionAwareMethodMatcherMethodMatcher.matches(java.lang.reflect.Method, Class) method
if the caller supports the extended IntroductionAwareMethodMatcher interface.matches in interface IntroductionAwareMethodMatchermethod - the candidate methodtargetClass - the target class (may be null, in which case
the candidate class must be taken to be the method's declaring class)beanHasIntroductions - true if the object on whose behalf we are
asking is the subject on one or more introductions; false otherwisepublic boolean matches(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
MethodMatcherfalse or if the MethodMatcher.isRuntime() method
returns false, no runtime check (i.e. no.
MethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) call) will be made.matches in interface MethodMatchermethod - the candidate methodtargetClass - the target class (may be null, in which case
the candidate class must be taken to be the method's declaring class)public boolean isRuntime()
MethodMatcherMethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method at
runtime even if the 2-arg matches method returns true?
Can be invoked when an AOP proxy is created, and need not be invoked again before each method invocation,
isRuntime in interface MethodMatcherMethodMatcher.matches(java.lang.reflect.Method, Class, Object[]) method
is required if static matching passedpublic boolean matches(java.lang.reflect.Method method,
java.lang.Class<?> targetClass,
java.lang.Object... args)
MethodMatcherThis method is invoked only if the 2-arg matches method returns
true for the given method and target class, and if the
MethodMatcher.isRuntime() method returns true. Invoked
immediately before potential running of the advice, after any
advice earlier in the advice chain has run.
matches in interface MethodMatchermethod - the candidate methodtargetClass - the target class (may be null, in which case
the candidate class must be taken to be the method's declaring class)args - arguments to the methodMethodMatcher.matches(Method, Class)protected java.lang.String getCurrentProxiedBeanName()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object