|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.aop.support.StaticMethodMatcher
org.springframework.aop.support.StaticMethodMatcherPointcut
org.springframework.aop.support.NameMatchMethodPointcut
public class NameMatchMethodPointcut
Pointcut bean for simple method name matches, as alternative to regexp patterns. Does not handle overloaded methods: all methods *with a given name will be eligible.
isMatch(java.lang.String, java.lang.String),
Serialized Form| Field Summary |
|---|
| Fields inherited from interface org.springframework.aop.Pointcut |
|---|
TRUE |
| Fields inherited from interface org.springframework.aop.MethodMatcher |
|---|
TRUE |
| Constructor Summary | |
|---|---|
NameMatchMethodPointcut()
|
|
| Method Summary | |
|---|---|
NameMatchMethodPointcut |
addMethodName(String name)
Add another eligible method name, in addition to those already named. |
boolean |
equals(Object other)
|
int |
hashCode()
|
protected boolean |
isMatch(String methodName,
String mappedName)
Return if the given method name matches the mapped name. |
boolean |
matches(Method method,
Class targetClass)
Perform static checking whether the given method matches. |
void |
setMappedName(String mappedName)
Convenience method when we have only a single method name to match. |
void |
setMappedNames(String[] mappedNames)
Set the method names defining methods to match. |
| Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut |
|---|
getClassFilter, getMethodMatcher, setClassFilter |
| Methods inherited from class org.springframework.aop.support.StaticMethodMatcher |
|---|
isRuntime, matches |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NameMatchMethodPointcut()
| Method Detail |
|---|
public void setMappedName(String mappedName)
setMappedNames, not both.
setMappedNames(java.lang.String[])public void setMappedNames(String[] mappedNames)
public NameMatchMethodPointcut addMethodName(String name)
NB: This method does not work after the proxy is in use, as advice chains will be cached.
name - name of the additional method that will match
public boolean matches(Method method,
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)
protected boolean isMatch(String methodName,
String mappedName)
The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses.
methodName - the method name of the classmappedName - the name in the descriptor
PatternMatchUtils.simpleMatch(String, String)public boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||