Package org.springframework.aop.support
Class NameMatchMethodPointcut
java.lang.Object
org.springframework.aop.support.StaticMethodMatcher
org.springframework.aop.support.StaticMethodMatcherPointcut
org.springframework.aop.support.NameMatchMethodPointcut
- All Implemented Interfaces:
- Serializable,- MethodMatcher,- Pointcut
Pointcut bean for simple method name matches, as an alternative to regexp patterns.
 
Does not handle overloaded methods: all methods with a given name will be eligible.
- Since:
- 11.02.2004
- Author:
- Juergen Hoeller, Rod Johnson, Rob Harrop
- See Also:
- 
Field SummaryFields inherited from interface org.springframework.aop.MethodMatcherTRUE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddMethodName(String name) Add another eligible method name, in addition to those already named.booleaninthashCode()protected booleanReturn if the given method name matches the mapped name.booleanPerform static checking whether the given method matches.voidsetMappedName(String mappedName) Convenience method when we have only a single method name to match.voidsetMappedNames(String... mappedNames) Set the method names defining methods to match.toString()Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcutgetClassFilter, getMethodMatcher, setClassFilterMethods inherited from class org.springframework.aop.support.StaticMethodMatcherisRuntime, matches
- 
Constructor Details- 
NameMatchMethodPointcutpublic NameMatchMethodPointcut()
 
- 
- 
Method Details- 
setMappedNameConvenience method when we have only a single method name to match. Use either this method orsetMappedNames, not both.- See Also:
 
- 
setMappedNamesSet the method names defining methods to match. Matching will be the union of all these; if any match, the pointcut matches.
- 
addMethodNameAdd another eligible method name, in addition to those already named. Like the set methods, this method is for use when configuring proxies, before a proxy is used.NB: This method does not work after the proxy is in use, as advice chains will be cached. - Parameters:
- name- the name of the additional method that will match
- Returns:
- this pointcut to allow for multiple additions in one line
 
- 
matchesDescription copied from interface:MethodMatcherPerform static checking whether the given method matches.If this returns falseor if theMethodMatcher.isRuntime()method returnsfalse, no runtime check (i.e. noMethodMatcher.matches(java.lang.reflect.Method, Class, Object[])call) will be made.- Specified by:
- matchesin interface- MethodMatcher
- Parameters:
- method- the candidate method
- targetClass- the target class
- Returns:
- whether this method matches statically
 
- 
isMatchReturn if the given method name matches the mapped name.The default implementation checks for "xxx*", "*xxx" and "*xxx*" matches, as well as direct equality. Can be overridden in subclasses. - Parameters:
- methodName- the method name of the class
- mappedName- the name in the descriptor
- Returns:
- if the names match
- See Also:
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-