ComposablePointcut class final
A pointcut built from other pointcuts with "or" (union) and "and" (intersection).
Use it to combine pointcuts written in code, such as a name pattern and an annotation, when one expression cannot say it. It is a mutable builder: both methods change this pointcut and return it, so calls chain.
The match is static: an ExpressionPointcut part that depends on the
call (args(id), bindings) counts as matching here; use it on its own
in an advisor to have it decided per call.
final pointcut = ComposablePointcut(
const NameMatchMethodPointcut(['find*']),
).union(const AnnotationMatchingPointcut<Timed>())
.intersection(ExpressionPointcut('within(*Service)'));
DefaultPointcutAdvisor(pointcut, LoggingInterceptor());
Spring (Java):
ComposablePointcut pointcut = new ComposablePointcut(findMethods)
.union(AnnotationMatchingPointcut.forMethodAnnotation(Timed.class))
.intersection(servicePointcut);
- Implemented types
Constructors
- ComposablePointcut([AopPointcut pointcut = const TruePointcut()])
-
Starts from
pointcut; by default every member matches.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
intersection(
AopPointcut other) → ComposablePointcut -
From now on, matches only what
othermatches too; returns this pointcut. -
matches(
MethodSignature signature, String beanName) → bool -
Whether the advice applies to the member described by
signatureof the bean namedbeanName.override -
matchesBean(
MethodSignature signature, String beanName, List< String> beanAliases, {List<String> introducedTypes = const []}) → bool -
Like matches, with the bean's aliases and qualifier values for the
bean(...)parts and the interfaces@DeclareParentsadds to its proxy (introducedTypes) forthis(...). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
union(
AopPointcut other) → ComposablePointcut -
From now on, also matches what
othermatches; returns this pointcut.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited