Package 

Class MethodHook


  • 
    public abstract class MethodHook
    
                        

    Interface definition for a callback that will be invoked before/after the method executes.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class MethodHook.Unhook
    • Method Summary

      Modifier and Type Method Description
      void beforeCall(Pine.CallFrame callFrame) Invoked before the method gets called.
      void afterCall(Pine.CallFrame callFrame) Invoked after the method gets called.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.