public class NameMatchMethodPointcut extends StaticMethodMatcherPointcut implements java.io.Serializable
isMatch(java.lang.String, java.lang.String),
Serialized FormTRUE| Constructor and Description |
|---|
NameMatchMethodPointcut() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
getClassFilter, getMethodMatcher, setClassFilterisRuntime, matchespublic 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 matchpublic boolean matches(java.lang.reflect.Method method,
java.lang.Class<?> targetClass)
MethodMatcherIf this returns 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 MethodMatchermethod - the candidate methodtargetClass - the target classprotected 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 descriptorPatternMatchUtils.simpleMatch(String, String)public boolean equals(java.lang.Object other)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object