intercept

abstract fun intercept(key: String, self: Any, args: Array<Any>): PatchDecision

Called before the patched method's body runs.

Return

Patches.proceed() to run the body, or Patches.returns(v) to skip it and return v. A value of the wrong type is refused and counted as a handler failure, leaving the method to run normally.

Parameters

key

the patch key that fired

self

the receiver of the patched method (null for static methods)

args

the arguments, boxed; assignments are written back into the parameter slots