Class Advice.AssignReturned.ToReturned.Handler

java.lang.Object
net.bytebuddy.asm.Advice.AssignReturned.ToReturned.Handler
All Implemented Interfaces:
Advice.AssignReturned.Handler
Enclosing class:
Advice.AssignReturned.ToReturned

@Enhance public static class Advice.AssignReturned.ToReturned.Handler extends Object implements Advice.AssignReturned.Handler
A handler for a Advice.AssignReturned.ToReturned annotation.
  • Field Details

    • index

      private final int index
      The index in the array that is returned which represents the assigned value or a negative value if assigning a scalar value.
    • typing

      private final Assigner.Typing typing
      The typing to apply when assigning the returned value to the targeted value.
  • Constructor Details

    • Handler

      protected Handler(int index, Assigner.Typing typing)
      Creates a new handler for a Advice.AssignReturned.ToReturned annotation.
      Parameters:
      index - The index in the array that is returned which represents the assigned value or a negative value if assigning a scalar value.
      typing - The typing to apply when assigning the returned value to the targeted value.
  • Method Details

    • getIndex

      public int getIndex()
      Returns the array offset which this handler intends to assign or a negative value if this handler intends to assign a scalar value.
      Specified by:
      getIndex in interface Advice.AssignReturned.Handler
      Returns:
      The array offset which this handler intends to assign or a negative value if this handler intends to assign a scalar value.
    • resolve

      public StackManipulation resolve(TypeDescription instrumentedType, MethodDescription instrumentedMethod, Assigner assigner, Advice.ArgumentHandler argumentHandler, TypeDescription type, StackManipulation value)
      Resolves this handler.
      Specified by:
      resolve in interface Advice.AssignReturned.Handler
      Parameters:
      instrumentedType - The instrumented type.
      instrumentedMethod - The instrumented method.
      assigner - The assigner to use.
      argumentHandler - The argument handler for the handled advice method.
      type - The type that this handler receives for assignment.
      value - An instruction to load the handled value onto the operand stack.
      Returns:
      The stack manipulation resolved by this handler.