|
|||||||||||
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.AbstractRegexpMethodPointcut
Abstract base regular expression pointcut bean. JavaBean properties are:
Note: the regular expressions must be a match. For example,
.*get.*
will match com.mycom.Foo.getBar().
get.*
will not.
This base class is serializable. Subclasses should declare all fields transient - the initPatternRepresentation method in this class will be invoked again on the client side on deserialization.
Perl5RegexpMethodPointcut
,
JdkRegexpMethodPointcut
,
Serialized FormField Summary | |
protected Log |
logger
Transient as it's reinitialized on deserialization. |
Fields inherited from interface org.springframework.aop.ClassFilter |
TRUE |
Fields inherited from interface org.springframework.aop.Pointcut |
TRUE |
Fields inherited from interface org.springframework.aop.MethodMatcher |
TRUE |
Constructor Summary | |
AbstractRegexpMethodPointcut()
|
Method Summary | |
ClassFilter |
getClassFilter()
|
String[] |
getPatterns()
Return the regular expressions for method matching. |
protected abstract void |
initPatternRepresentation(String[] patterns)
Subclasses must implement this to initialize regexp pointcuts. |
boolean |
matches(Class clazz)
Should the pointcut apply to the given interface or target class? |
boolean |
matches(Method method,
Class targetClass)
Try to match the regular expression against the fully qualified name of the method's declaring class, plus the name of the method. |
protected abstract boolean |
matches(String pattern,
int patternIndex)
Does the pattern at the given index match this string? |
void |
setPattern(String pattern)
Convenience method when we have only a single pattern. |
void |
setPatterns(String[] patterns)
Set the regular expressions defining methods to match. |
Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut |
getMethodMatcher, setClassFilter |
Methods inherited from class org.springframework.aop.support.StaticMethodMatcher |
isRuntime, matches |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient Log logger
Constructor Detail |
public AbstractRegexpMethodPointcut()
Method Detail |
public void setPattern(String pattern)
setPatterns(java.lang.String[])
public void setPatterns(String[] patterns)
patterns
- regular expressions describing methods to matchpublic String[] getPatterns()
protected abstract void initPatternRepresentation(String[] patterns) throws IllegalArgumentException
This method will be invoked from the setPatterns method, and also on deserialization.
patterns
- the patterns to initialize
IllegalArgumentException
- in case of an invalid patternprotected abstract boolean matches(String pattern, int patternIndex)
pattern
- string pattern to matchpatternIndex
- index of pattern from 0
public final boolean matches(Method method, Class targetClass)
For example, "java.lang.Object.hashCode" matches any subclass
of Object's hashCode()
method.
matches
in interface MethodMatcher
method
- the candidate methodtargetClass
- target class (may be null, in which case the candidate
class must be taken to be the method's declaring class)
public boolean matches(Class clazz)
ClassFilter
matches
in interface ClassFilter
clazz
- candidate target class
public final ClassFilter getClassFilter()
getClassFilter
in interface Pointcut
getClassFilter
in class StaticMethodMatcherPointcut
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |