Class JavaDispatcher.Dispatcher.ForStaticMethod

java.lang.Object
net.bytebuddy.utility.dispatcher.JavaDispatcher.Dispatcher.ForStaticMethod
All Implemented Interfaces:
JavaDispatcher.Dispatcher
Enclosing interface:
JavaDispatcher.Dispatcher

@Enhance public static class JavaDispatcher.Dispatcher.ForStaticMethod extends Object implements JavaDispatcher.Dispatcher
A dispatcher for invoking a static proxied method.
  • Field Details

    • method

      private final Method method
      The proxied method.
  • Constructor Details

    • ForStaticMethod

      protected ForStaticMethod(Method method)
      Creates a dispatcher for invoking a static method.
      Parameters:
      method - The proxied method.
  • Method Details

    • invoke

      @MaybeNull public Object invoke(Object[] argument) throws Throwable
      Invokes the proxied action.
      Specified by:
      invoke in interface JavaDispatcher.Dispatcher
      Parameters:
      argument - The arguments provided.
      Returns:
      The return value.
      Throws:
      Throwable - If any error occurs.
    • apply

      public int apply(org.objectweb.asm.MethodVisitor methodVisitor, Method method)
      Implements this dispatcher in a generated proxy.
      Specified by:
      apply in interface JavaDispatcher.Dispatcher
      Parameters:
      methodVisitor - The method visitor to implement the method with.
      method - The method being implemented.
      Returns:
      The maximal size of the operand stack.