AnnotationMatchingPointcut<A> class
final
A pointcut that matches members carrying an annotation of type A, or
every member of beans whose class carries it.
Use it in an advisor for annotation-driven advice: a @Timed() marker
on the methods to time. It tests the runtime type of the const
annotation objects, so A must be the annotation class. On members it
reads MethodSignature.annotations (like @annotation(...), not the
overridden declarations'); with onClass, the bean class's
annotations.
// Methods annotated with @Timed().
const AnnotationMatchingPointcut<Timed>();
// Every member of classes annotated with @Service().
const AnnotationMatchingPointcut<Service>(onClass: true);
Spring (Java):
AnnotationMatchingPointcut.forMethodAnnotation(Timed.class);
AnnotationMatchingPointcut.forClassAnnotation(Service.class);
- Implemented types
Constructors
- AnnotationMatchingPointcut({bool onClass = false})
-
Matches members annotated with
A, or withonClassevery member of a bean whose class is.const
Properties
Methods
-
matches(
MethodSignature signature, String beanName) → bool -
Whether the advice applies to the member described by
signatureof the bean namedbeanName.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited