public class ComposablePointcut extends java.lang.Object implements Pointcut, java.io.Serializable
All methods return ComposablePointcut
, so we can use concise idioms
like in the following example.
Pointcut pc = new ComposablePointcut() .union(classFilter) .intersection(methodMatcher) .intersection(pointcut);
Pointcuts
,
Serialized FormModifier and Type | Field and Description |
---|---|
private ClassFilter |
classFilter |
private MethodMatcher |
methodMatcher |
private static long |
serialVersionUID
use serialVersionUID from Spring 1.2 for interoperability.
|
Constructor and Description |
---|
ComposablePointcut()
Create a default ComposablePointcut, with
ClassFilter.TRUE
and MethodMatcher.TRUE . |
ComposablePointcut(ClassFilter classFilter)
Create a ComposablePointcut for the given ClassFilter,
with
MethodMatcher.TRUE . |
ComposablePointcut(ClassFilter classFilter,
MethodMatcher methodMatcher)
Create a ComposablePointcut for the given ClassFilter and MethodMatcher.
|
ComposablePointcut(MethodMatcher methodMatcher)
Create a ComposablePointcut for the given MethodMatcher,
with
ClassFilter.TRUE . |
ComposablePointcut(Pointcut pointcut)
Create a ComposablePointcut based on the given Pointcut.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
ClassFilter |
getClassFilter()
Return the ClassFilter for this pointcut.
|
MethodMatcher |
getMethodMatcher()
Return the MethodMatcher for this pointcut.
|
int |
hashCode() |
ComposablePointcut |
intersection(ClassFilter other)
Apply an intersection with the given ClassFilter.
|
ComposablePointcut |
intersection(MethodMatcher other)
Apply an intersection with the given MethodMatcher.
|
ComposablePointcut |
intersection(Pointcut other)
Apply an intersection with the given Pointcut.
|
java.lang.String |
toString() |
ComposablePointcut |
union(ClassFilter other)
Apply a union with the given ClassFilter.
|
ComposablePointcut |
union(MethodMatcher other)
Apply a union with the given MethodMatcher.
|
ComposablePointcut |
union(Pointcut other)
Apply a union with the given Pointcut.
|
private static final long serialVersionUID
private ClassFilter classFilter
private MethodMatcher methodMatcher
public ComposablePointcut()
ClassFilter.TRUE
and MethodMatcher.TRUE
.public ComposablePointcut(Pointcut pointcut)
pointcut
- the original Pointcutpublic ComposablePointcut(ClassFilter classFilter)
MethodMatcher.TRUE
.classFilter
- the ClassFilter to usepublic ComposablePointcut(MethodMatcher methodMatcher)
ClassFilter.TRUE
.methodMatcher
- the MethodMatcher to usepublic ComposablePointcut(ClassFilter classFilter, MethodMatcher methodMatcher)
classFilter
- the ClassFilter to usemethodMatcher
- the MethodMatcher to usepublic ComposablePointcut union(ClassFilter other)
other
- the ClassFilter to apply a union withpublic ComposablePointcut intersection(ClassFilter other)
other
- the ClassFilter to apply an intersection withpublic ComposablePointcut union(MethodMatcher other)
other
- the MethodMatcher to apply a union withpublic ComposablePointcut intersection(MethodMatcher other)
other
- the MethodMatcher to apply an intersection withpublic ComposablePointcut union(Pointcut other)
Note that for a Pointcut union, methods will only match if their original ClassFilter (from the originating Pointcut) matches as well. MethodMatchers and ClassFilters from different Pointcuts will never get interleaved with each other.
other
- the Pointcut to apply a union withpublic ComposablePointcut intersection(Pointcut other)
other
- the Pointcut to apply an intersection withpublic ClassFilter getClassFilter()
Pointcut
getClassFilter
in interface Pointcut
null
)public MethodMatcher getMethodMatcher()
Pointcut
getMethodMatcher
in interface Pointcut
null
)public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object