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 with onClass every member of a bean whose class is.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
onClass → bool
Whether to test the bean class's annotations instead of the member's; false by default.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

matches(MethodSignature signature, String beanName) → bool
Whether the advice applies to the member described by signature of the bean named beanName.
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