|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 FormField Summary | |
---|---|
private java.util.List<java.lang.String> |
mappedNames
|
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(java.lang.String name)
Add another eligible method name, in addition to those already named. |
boolean |
equals(java.lang.Object other)
|
int |
hashCode()
|
protected boolean |
isMatch(java.lang.String methodName,
java.lang.String mappedName)
Return if the given method name matches the mapped name. |
boolean |
matches(java.lang.reflect.Method method,
java.lang.Class targetClass)
Perform static checking whether the given method matches. |
void |
setMappedName(java.lang.String mappedName)
Convenience method when we have only a single method name to match. |
void |
setMappedNames(java.lang.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 |
Field Detail |
---|
private java.util.List<java.lang.String> mappedNames
Constructor Detail |
---|
public NameMatchMethodPointcut()
Method Detail |
---|
public void setMappedName(java.lang.String mappedName)
setMappedNames
, not both.
setMappedNames(java.lang.String[])
public void setMappedNames(java.lang.String[] mappedNames)
public NameMatchMethodPointcut addMethodName(java.lang.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(java.lang.reflect.Method method, java.lang.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)
protected boolean isMatch(java.lang.String methodName, java.lang.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(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |