AdviceKind enum

The five kinds of aspect advice, one per annotation, listed in the order they nest inside one aspect.

Generated code tags each AspectAdvice with its kind, and the container uses it to decide how the advice runs (before the call, after it, around it) and in which order. Within one aspect, an earlier kind wraps a later one: around, then before, after, afterReturning, afterThrowing; advice of the same kind keeps declaration order. Applications meet it only when reading the advice of an aspect or writing an AspectAdvice by hand.

// The @Before advice method `before` of AuditAspect.
AspectAdvice<AuditAspect>(
  kind: AdviceKind.before,
  pointcut: 'calculator()',
  methodName: 'before',
  invoke: (aspect, joinPoint, _, _) => aspect.before(joinPoint),
);

Spring (Java):

// ReflectiveAspectJAdvisorFactory sorts advice methods by
// Around, Before, After, AfterReturning, AfterThrowing.
Inheritance
Available extensions

Values

around → const AdviceKind

@Around: runs instead of the call and decides whether it proceeds.

before → const AdviceKind

@Before: runs before the call.

after → const AdviceKind

@After: runs after the call, whether it returned or threw.

afterReturning → const AdviceKind

@AfterReturning: runs after the call returned, with the result.

afterThrowing → const AdviceKind

@AfterThrowing: runs after the call threw, with the error.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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

Constants

values → const List<AdviceKind>
A constant List of the values in this enum, in order of their declaration.