Class InvokeDynamic.WithImplicitTarget

All Implemented Interfaces:
InstrumentedType.Prepareable, Implementation, Implementation.Composable
Enclosing class:
InvokeDynamic

public static class InvokeDynamic.WithImplicitTarget extends InvokeDynamic.WithImplicitArguments
Representation of an InvokeDynamic implementation where the bootstrapped method is passed a this reference, if available, and any arguments of the instrumented method and where the invocation target is implicit.
  • Constructor Details

    • WithImplicitTarget

      protected WithImplicitTarget(MethodDescription.InDefinedShape bootstrap, List<? extends JavaConstant> arguments, InvokeDynamic.InvocationProvider invocationProvider, InvokeDynamic.TerminationHandler terminationHandler, Assigner assigner, Assigner.Typing typing)
      Creates a new dynamic method invocation with implicit arguments and an implicit invocation target.
      Parameters:
      bootstrap - The bootstrap method or constructor.
      arguments - The arguments that are provided to the bootstrap method.
      invocationProvider - The target provided that identifies the method to be bootstrapped.
      terminationHandler - A handler that handles the method return.
      assigner - The assigner to be used.
      typing - Indicates if dynamic type castings should be attempted for incompatible assignments.
  • Method Details

    • invoke

      public InvokeDynamic.WithImplicitArguments invoke(Class<?> returnType)
      Requests the bootstrap method to bind a method with the given return type. The return type is assigned to the intercepted method's return type.
      Parameters:
      returnType - The return type to request from the bootstrapping method.
      Returns:
      This implementation where the bootstrap method is requested to bind a method with the given return type.
    • invoke

      Requests the bootstrap method to bind a method with the given return type. The return type is assigned to the intercepted method's return type.
      Parameters:
      returnType - The return type to request from the bootstrapping method.
      Returns:
      This implementation where the bootstrap method is requested to bind a method with the given return type.
    • invoke

      public InvokeDynamic.WithImplicitArguments invoke(String methodName)
      Requests the bootstrap method is passed the given method name.
      Parameters:
      methodName - The method name to pass to the bootstrapping method.
      Returns:
      This implementation where the bootstrap method is passed the given method name.
    • invoke

      public InvokeDynamic.WithImplicitArguments invoke(String methodName, Class<?> returnType)
      Requests the bootstrap method to bind a method with the given return type. The return type is assigned to the intercepted method's return type. Also, the bootstrap method is passed the given method name.
      Parameters:
      methodName - The method name to pass to the bootstrapping method.
      returnType - The return type to request from the bootstrapping method.
      Returns:
      This implementation where the bootstrap method is requested to bind a method with the given return type while being passed the given method name.
    • invoke

      public InvokeDynamic.WithImplicitArguments invoke(String methodName, TypeDescription returnType)
      Requests the bootstrap method to bind a method with the given return type. The return type is assigned to the intercepted method's return type. Also, the bootstrap method is passed the given method name.
      Parameters:
      methodName - The method name to pass to the bootstrapping method.
      returnType - The return type to request from the bootstrapping method.
      Returns:
      This implementation where the bootstrap method is requested to bind a method with the given return type while being passed the given method name.