Join Point
Provides contextual information about an intercepted function call.
A JoinPoint instance is constructed by the AspectK compiler plugin at each intercepted call site and passed to every matching advice function. It exposes the receiver object, static method-signature metadata, and the runtime arguments of the call.
The concrete implementation injected at runtime is io.github.molelabs.aspectk.runtime.internal.DefaultJoinPoint. Advice code should program to this interface rather than the concrete type.
Usage in advice
@Before(target = [Authenticated::class])
fun checkAuth(joinPoint: JoinPoint) {
val receiver = joinPoint.target // null for top-level functions
val name = joinPoint.signature.methodName
val firstArg = joinPoint.args.firstOrNull()
// Type-safe argument access:
val userId = joinPoint.args[0] as? String
}See also
Inheritors
Properties
Functions
Returns the AnnotationInfo for annotation T present on the intercepted function, or null if no such annotation is present.
Returns the arguments of annotation T on the intercepted function, by parameter name.
Returns JoinPoint.target cast to T, or null if the target is null or cannot be cast to T.