Package org.springframework.aop.support
Class JdkRegexpMethodPointcut
- java.lang.Object
- org.springframework.aop.support.StaticMethodMatcher
- org.springframework.aop.support.StaticMethodMatcherPointcut
- org.springframework.aop.support.AbstractRegexpMethodPointcut
- org.springframework.aop.support.JdkRegexpMethodPointcut
- All Implemented Interfaces:
Serializable
,MethodMatcher
,Pointcut
public class JdkRegexpMethodPointcut extends AbstractRegexpMethodPointcut
Regular expression pointcut based on thejava.util.regex
package. Supports the following JavaBean properties:- pattern: regular expression for the fully-qualified method names to match
- patterns: alternative property taking a String array of patterns. The result will be the union of these patterns.
Note: the regular expressions must be a match. For example,
.*get.*
will match com.mycom.Foo.getBar().get.*
will not.- Since:
- 1.1
- Author:
- Dmitriy Kopylenko, Rob Harrop
- See Also:
- Serialized Form
Field Summary
Fields inherited from interface org.springframework.aop.MethodMatcher
TRUE
Constructor Summary
Constructors Constructor Description JdkRegexpMethodPointcut()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
initExcludedPatternRepresentation(String[] excludedPatterns)
Initialize exclusionPatterns
from the suppliedString[]
.protected void
initPatternRepresentation(String[] patterns)
InitializePatterns
from the suppliedString[]
.protected boolean
matches(String pattern, int patternIndex)
protected boolean
matchesExclusion(String candidate, int patternIndex)
Methods inherited from class org.springframework.aop.support.AbstractRegexpMethodPointcut
equals, getExcludedPatterns, getPatterns, hashCode, matches, matchesPattern, setExcludedPattern, setExcludedPatterns, setPattern, setPatterns, toString
Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut
getClassFilter, getMethodMatcher, setClassFilter
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher
isRuntime, matches
Constructor Detail
JdkRegexpMethodPointcut
public JdkRegexpMethodPointcut()
Method Detail
initPatternRepresentation
protected void initPatternRepresentation(String[] patterns) throws PatternSyntaxException
InitializePatterns
from the suppliedString[]
.- Specified by:
initPatternRepresentation
in classAbstractRegexpMethodPointcut
- Parameters:
patterns
- the patterns to initialize- Throws:
PatternSyntaxException
initExcludedPatternRepresentation
protected void initExcludedPatternRepresentation(String[] excludedPatterns) throws PatternSyntaxException
Initialize exclusionPatterns
from the suppliedString[]
.- Specified by:
initExcludedPatternRepresentation
in classAbstractRegexpMethodPointcut
- Parameters:
excludedPatterns
- the patterns to initialize- Throws:
PatternSyntaxException
matches
protected boolean matches(String pattern, int patternIndex)
- Specified by:
matches
in classAbstractRegexpMethodPointcut
- Parameters:
pattern
- theString
pattern to matchpatternIndex
- index of pattern (starting from 0)- Returns:
true
if there is a match,false
otherwise
matchesExclusion
protected boolean matchesExclusion(String candidate, int patternIndex)
- Specified by:
matchesExclusion
in classAbstractRegexpMethodPointcut
- Parameters:
candidate
- theString
pattern to matchpatternIndex
- index of pattern (starting from 0)- Returns:
true
if there is a match,false
otherwise