onIntercept

open fun onIntercept(key: String, sig: MethodType, self: Any, args: Array<Any>): Any

Head-side decision, before the body runs. Writing into args rewrites the method's arguments.

Return

null to run the body, or an Object[1] whose element 0 replaces the return value — the carrier is a JDK array so the cast in the woven advice resolves on every loader

Parameters

key

the patch key that fired

sig

the patched method's signature, woven in per copy as a constant — parameter types validate an argument rewrite, the return type validates a substitute. Its parameter 0 is the receiver on an instance method, which args does not carry

self

the receiver (null for static methods)

args

the arguments, boxed; written back into the method's parameter slots on return