-
public abstract class MethodHookInterface definition for a callback that will be invoked before/after the method executes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMethodHook.Unhook
-
Method Summary
Modifier and Type Method Description voidbeforeCall(Pine.CallFrame callFrame)Invoked before the method gets called. voidafterCall(Pine.CallFrame callFrame)Invoked after the method gets called. -
-
Method Detail
-
beforeCall
void beforeCall(Pine.CallFrame callFrame)
Invoked before the method gets called. You can get or modify some info about this call by the given
{@code callFrame}.Note that setting result or exception will prevent the original method call, and next hooks won'tbe called. Throwing any exception in this method will cause the result or exception you setgets reset, if you want to set an exception as the method thrown, use setThrowable- Parameters:
callFrame- object that stores some info about info call.
-
afterCall
void afterCall(Pine.CallFrame callFrame)
Invoked after the method gets called. You can get or modify some info about this call by the given
{@code callFrame}.Throwing any exception in this method will cause the result or exception you set gets reset.If you want to set an exception as the method thrown, use setThrowable- Parameters:
callFrame- object that stores some info about info call.
-
-
-
-