Class NameMatchMethodPointcut
- All Implemented Interfaces:
- Serializable,- MethodMatcher,- Pointcut
Each configured method name can be an exact method name or a method name
 pattern (see isMatch(String, String) for details on the supported
 pattern styles).
 
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, Sam Brannen
- See Also:
- 
Field SummaryFields inherited from interface org.springframework.aop.MethodMatcherTRUE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddMethodName(String mappedNamePattern) Add another method name pattern, in addition to those already configured.booleaninthashCode()protected booleanDetermine if the given method name matches the mapped name pattern.booleanPerform static checking to determine whether the given method matches.voidsetMappedName(String mappedNamePattern) Convenience method for configuring a single method name pattern.voidsetMappedNames(String... mappedNamePatterns) Set the method name patterns 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 for configuring a single method name pattern.Use either this method or setMappedNames(String...), but not both.- See Also:
 
- 
setMappedNamesSet the method name patterns defining methods to match.Matching will be the union of all these; if any match, the pointcut matches. - See Also:
 
- 
addMethodNameAdd another method name pattern, in addition to those already configured.Like the "set" methods, this method is for use when configuring proxies, before a proxy is used. NOTE: This method does not work after the proxy is in use, since advice chains will be cached. - Parameters:
- mappedNamePattern- the additional method name pattern
- Returns:
- this pointcut to allow for method chaining
- See Also:
 
- 
matchesDescription copied from interface:MethodMatcherPerform static checking to determine whether the given method matches.If this method returns falseor ifMethodMatcher.isRuntime()returnsfalse, no runtime check (i.e. noMethodMatcher.matches(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
 
- 
isMatchDetermine if the given method name matches the mapped name pattern.The default implementation checks for xxx*,*xxx,*xxx*, andxxx*yyymatches, as well as direct equality.Can be overridden in subclasses. - Parameters:
- methodName- the method name to check
- mappedNamePattern- the method name pattern
- Returns:
- trueif the method name matches the pattern
- See Also:
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
 
-