|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.aop.support.AbstractPointcutAdvisor org.springframework.aop.support.AbstractGenericPointcutAdvisor org.springframework.aop.support.RegexpMethodPointcutAdvisor
public class RegexpMethodPointcutAdvisor
Convenient class for regexp method pointcuts that hold an Advice, making them an Advisor.
Configure this class using the "pattern" and "patterns" pass-through properties. These are analogous to the pattern and patterns properties of AbstractRegexpMethodPointcut.
Can delegate to any AbstractRegexpMethodPointcut subclass,
like Perl5RegexpMethodPointcut or JdkRegexpMethodPointcut.
To choose a specific one, either override createPointcut
or set the "perl5" flag accordingly.
By default, JdkRegexpMethodPointcut will be used on JDK 1.4+, falling back to Perl5RegexpMethodPointcut on JDK 1.3 (requiring Jakarta ORO on the classpath). The use of Perl5RegexpMethodPointcut can be enforced through specifying the "perl5" property.
setPattern(java.lang.String)
,
setPatterns(java.lang.String[])
,
setPerl5(boolean)
,
createPointcut()
,
AbstractRegexpMethodPointcut
,
Perl5RegexpMethodPointcut
,
JdkRegexpMethodPointcut
,
Serialized FormField Summary |
---|
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
RegexpMethodPointcutAdvisor()
Create an empty RegexpMethodPointcutAdvisor. |
|
RegexpMethodPointcutAdvisor(Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice. |
|
RegexpMethodPointcutAdvisor(String[] patterns,
Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice. |
|
RegexpMethodPointcutAdvisor(String pattern,
Advice advice)
Create a RegexpMethodPointcutAdvisor for the given advice. |
Method Summary | |
---|---|
protected AbstractRegexpMethodPointcut |
createPointcut()
Create the actual pointcut: by default, a Perl5RegexpMethodPointcut will be created if Perl5 syntax is enforced or when running on JDK 1.3. |
Pointcut |
getPointcut()
Initialize the singleton pointcut held within this advisor. |
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. |
void |
setPerl5(boolean perl5)
Set whether to enforce Perl5 regexp syntax. |
String |
toString()
|
Methods inherited from class org.springframework.aop.support.AbstractGenericPointcutAdvisor |
---|
getAdvice, setAdvice |
Methods inherited from class org.springframework.aop.support.AbstractPointcutAdvisor |
---|
equals, getOrder, hashCode, isPerInstance, setOrder |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RegexpMethodPointcutAdvisor()
setPattern(java.lang.String)
,
setPatterns(java.lang.String[])
,
setPerl5(boolean)
,
AbstractGenericPointcutAdvisor.setAdvice(org.aopalliance.aop.Advice)
public RegexpMethodPointcutAdvisor(Advice advice)
advice
- the advice to usesetPattern(java.lang.String)
,
setPatterns(java.lang.String[])
,
setPerl5(boolean)
public RegexpMethodPointcutAdvisor(String pattern, Advice advice)
pattern
- the pattern to useadvice
- the advice to usesetPerl5(boolean)
public RegexpMethodPointcutAdvisor(String[] patterns, Advice advice)
patterns
- the patterns to useadvice
- the advice to usesetPerl5(boolean)
Method Detail |
---|
public void setPattern(String pattern)
setPatterns
, not both.
To be passed through to the pointcut implementation.
setPatterns(java.lang.String[])
public void setPatterns(String[] patterns)
Matching will be the union of all these; if any of the patterns matches, the pointcut matches.
To be passed through to the pointcut implementation.
patterns
- regular expressions describing methods to matchpublic void setPerl5(boolean perl5)
Alternatively, override the createPointcut
method.
createPointcut()
,
Perl5RegexpMethodPointcut
,
JdkRegexpMethodPointcut
public Pointcut getPointcut()
protected AbstractRegexpMethodPointcut createPointcut()
setPerl5(boolean)
,
Perl5RegexpMethodPointcut
,
JdkRegexpMethodPointcut
public String toString()
toString
in class AbstractGenericPointcutAdvisor
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |