Class JavaDispatcher.Dispatcher.ForConstructor

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

@Enhance public static class JavaDispatcher.Dispatcher.ForConstructor extends Object implements JavaDispatcher.Dispatcher
A dispatcher for invoking a constructor.
  • Field Details

    • constructor

      private final Constructor<?> constructor
      The proxied constructor.
  • Constructor Details

    • ForConstructor

      protected ForConstructor(Constructor<?> constructor)
      Creates a dispatcher for invoking a constructor.
      Parameters:
      constructor - The proxied constructor.
  • Method Details

    • invoke

      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.