After class

Marks an aspect method to run after each matched call, whether it returned or threw, like a finally block.

Use it for clean-up and "call finished" logging. It cannot change the result or the error. For a method returning a Future, it runs when the future completes, not when the method returns.

// Records the end of every Calculator call, even a failed one.
@After('execution(* Calculator.*(..))')
void after() => log.add('after');

Spring (Java):

@After("execution(* Calculator.*(..))")
void after() { log.add("after"); }

Constructors

After(String pointcut)
Runs the annotated method after calls matching pointcut.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
pointcut → String
The pointcut expression selecting the advised methods.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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