Class ByteCodeAppender.Simple

java.lang.Object
net.bytebuddy.implementation.bytecode.ByteCodeAppender.Simple
All Implemented Interfaces:
ByteCodeAppender
Enclosing interface:
ByteCodeAppender

@Enhance public static class ByteCodeAppender.Simple extends Object implements ByteCodeAppender
A simple byte code appender that only represents a given array of StackManipulations.
  • Field Details

    • stackManipulation

      private final StackManipulation stackManipulation
      A compound stack manipulation to be applied for this byte code appender.
  • Constructor Details

    • Simple

      public Simple(StackManipulation... stackManipulation)
      Creates a new simple byte code appender which represents the given stack manipulation.
      Parameters:
      stackManipulation - The stack manipulations to apply for this byte code appender in their application order.
    • Simple

      public Simple(List<? extends StackManipulation> stackManipulations)
      Creates a new simple byte code appender which represents the given stack manipulation.
      Parameters:
      stackManipulations - The stack manipulations to apply for this byte code appender in their application order.
  • Method Details

    • apply

      public ByteCodeAppender.Size apply(org.objectweb.asm.MethodVisitor methodVisitor, Implementation.Context implementationContext, MethodDescription instrumentedMethod)
      Applies this byte code appender to a type creation process.
      Specified by:
      apply in interface ByteCodeAppender
      Parameters:
      methodVisitor - The method visitor to which the byte code appender writes its code to.
      implementationContext - The implementation context of the current type creation process.
      instrumentedMethod - The method that is the target of the instrumentation.
      Returns:
      The required size for the applied byte code to run.