|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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 org.apache.commons.logging.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()
|
java.lang.String[] |
getPatterns()
Return the regular expressions for method matching. |
protected abstract void |
initPatternRepresentation(java.lang.String[] patterns)
Subclasses must implement this to initialize regexp pointcuts. |
boolean |
matches(java.lang.Class clazz)
Should the pointcut apply to the given interface or target class? |
boolean |
matches(java.lang.reflect.Method m,
java.lang.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(java.lang.String pattern,
int patternIndex)
Does the pattern at the given index match this string? |
void |
setPattern(java.lang.String pattern)
Convenience method when we have only a single pattern. |
void |
setPatterns(java.lang.String[] patterns)
Set the regular expressions defining methods to match. |
Methods inherited from class org.springframework.aop.support.StaticMethodMatcherPointcut |
getMethodMatcher |
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 org.apache.commons.logging.Log logger
Constructor Detail |
public AbstractRegexpMethodPointcut()
Method Detail |
public void setPattern(java.lang.String pattern)
setPatterns(java.lang.String[])
public void setPatterns(java.lang.String[] patterns)
patterns
- Perl5 regular expressions describing methods
to matchpublic java.lang.String[] getPatterns()
protected abstract void initPatternRepresentation(java.lang.String[] patterns) throws java.lang.IllegalArgumentException
This method will be invoked from the setPatterns method, and also on deserialization.
patterns
- the patterns to initialize
java.lang.IllegalArgumentException
- in case of an invalid patternprotected abstract boolean matches(java.lang.String pattern, int patternIndex)
pattern
- string pattern to matchpatternIndex
- index of pattern from 0
public final boolean matches(java.lang.reflect.Method m, java.lang.Class targetClass)
For example, java.lang.Object.hashCode
matches
any subclass of object's hashCode() method.
matches
in interface MethodMatcher
m
- 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(java.lang.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 |