Before class

Marks an aspect method to run before each matched call.

Use it for checks and logging that must happen before the method body. The advice may take a JoinPoint to read the method and its arguments. It cannot change the arguments or the result; throwing an error stops the call, and the caller gets that error. On a method returning a Future the advice may be async: the call waits for it before the method runs. On a synchronous method an async advice fails the call with an AopInvocationException.

// Records each Calculator call before it runs.
@Before('execution(* Calculator.*(..))')
void before(JoinPoint joinPoint) => log.add(joinPoint.toShortString());

Spring (Java):

@Before("execution(* Calculator.*(..))")
void before(JoinPoint joinPoint) { log.add(joinPoint.toShortString()); }

Constructors

Before(String pointcut)
Runs the annotated method before 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