|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.support.AbstractExpressionPointcut org.springframework.aop.aspectj.AspectJExpressionPointcut
public class AspectJExpressionPointcut
Spring 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.
Field Summary |
---|
Fields inherited from interface org.springframework.aop.ClassFilter |
---|
TRUE |
Fields inherited from interface org.springframework.aop.Pointcut |
---|
TRUE |
Constructor Summary | |
---|---|
AspectJExpressionPointcut()
Create a new default AspectJExpressionPointcut. |
|
AspectJExpressionPointcut(Class declarationScope,
String[] paramNames,
Class[] paramTypes)
Create a new AspectJExpressionPointcut with the given settings. |
|
AspectJExpressionPointcut(Set supportedPrimitives)
Create a new AspectJExpressionPointcut with the given supported primitives. |
Method Summary | |
---|---|
boolean |
equals(Object other)
|
ClassFilter |
getClassFilter()
Return the ClassFilter for this pointcut. |
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(Class targetClass)
Should the pointcut apply to the given interface or target class? |
boolean |
matches(Method method,
Class targetClass)
Perform static checking whether the given method matches. |
boolean |
matches(Method method,
Class targetClass,
boolean beanHasIntroductions)
Perform static checking whether the given method matches. |
boolean |
matches(Method method,
Class targetClass,
Object[] args)
Check whether there a runtime (dynamic) match for this method, which must have matched statically. |
void |
setParameterNames(String[] names)
Set the parameter names for the pointcut. |
void |
setParameterTypes(Class[] types)
Set the parameter types for the pointcut. |
void |
setPointcutDeclarationScope(Class pointcutDeclarationScope)
Set the declaration scope for the pointcut. |
String |
toString()
|
Methods inherited from class org.springframework.aop.support.AbstractExpressionPointcut |
---|
getExpression, getLocation, onSetExpression, setExpression, setLocation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AspectJExpressionPointcut()
public AspectJExpressionPointcut(Set supportedPrimitives)
supportedPrimitives
- Set of PointcutPrimitive
instancespublic AspectJExpressionPointcut(Class declarationScope, String[] paramNames, Class[] paramTypes)
declarationScope
- the declaration scope for the pointcutparamNames
- the parameter names for the pointcutparamTypes
- the parameter types for the pointcutMethod Detail |
---|
public void setPointcutDeclarationScope(Class pointcutDeclarationScope)
public void setParameterNames(String[] names)
public void setParameterTypes(Class[] types)
public ClassFilter getClassFilter()
Pointcut
getClassFilter
in interface Pointcut
null
)public MethodMatcher getMethodMatcher()
Pointcut
getMethodMatcher
in interface Pointcut
null
)public org.aspectj.weaver.tools.PointcutExpression getPointcutExpression()
public boolean matches(Class targetClass)
ClassFilter
matches
in interface ClassFilter
targetClass
- the candidate target class
public boolean matches(Method method, Class targetClass, boolean beanHasIntroductions)
IntroductionAwareMethodMatcher
MethodMatcher.matches(java.lang.reflect.Method, Class)
method
if the caller supports the extended IntroductionAwareMethodMatcher interface.
matches
in interface IntroductionAwareMethodMatcher
method
- 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
otherwise
public boolean matches(Method method, Class targetClass)
MethodMatcher
false
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 MethodMatcher
method
- 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()
MethodMatcher
MethodMatcher.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 MethodMatcher
MethodMatcher.matches(java.lang.reflect.Method, Class, Object[])
method
is required if static matching passedpublic boolean matches(Method method, Class targetClass, Object[] args)
MethodMatcher
This 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 MethodMatcher
method
- 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 method
MethodMatcher.matches(Method, Class)
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |