Class Implementation.Simple

java.lang.Object
net.bytebuddy.implementation.Implementation.Simple
All Implemented Interfaces:
InstrumentedType.Prepareable, Implementation
Enclosing interface:
Implementation

@Enhance public static class Implementation.Simple extends Object implements Implementation
A simple implementation that does not register any members with the instrumented type.
  • Field Details

    • NO_ADDITIONAL_VARIABLES

      private static final int NO_ADDITIONAL_VARIABLES
      Indicates that no additional local variable slots are required.
      See Also:
    • byteCodeAppender

      private final ByteCodeAppender byteCodeAppender
      The byte code appender to emmit.
  • Constructor Details

    • Simple

      public Simple(ByteCodeAppender... byteCodeAppender)
      Creates a new simple implementation for the given byte code appenders.
      Parameters:
      byteCodeAppender - The byte code appenders to apply in their order of application.
    • Simple

      public Simple(StackManipulation... stackManipulation)
      Creates a new simple instrumentation for the given stack manipulations which are summarized in a byte code appender that defines any requested method by these manipulations.
      Parameters:
      stackManipulation - The stack manipulation to apply in their order of application.
  • Method Details

    • of

      public static Implementation of(Implementation.Simple.Dispatcher dispatcher)
      Resolves a simple implementation that applies the given dispatcher without defining additional local variables.
      Parameters:
      dispatcher - The dispatcher to use.
      Returns:
      An implementation for the supplied dispatcher.
    • of

      public static Implementation of(Implementation.Simple.Dispatcher dispatcher, int additionalVariableLength)
      Resolves a simple implementation that applies the given dispatcher.
      Parameters:
      dispatcher - The dispatcher to use.
      additionalVariableLength - The amount of additional slots required in the local variable array.
      Returns:
      An implementation for the supplied dispatcher.
    • of

      Resolves a simple implementation that applies the given dispatcher without defining additional local variables.
      Parameters:
      dispatcher - The dispatcher to use.
      prepareable - A preparation of the instrumented type.
      Returns:
      An implementation for the supplied dispatcher.
    • of

      public static Implementation of(Implementation.Simple.Dispatcher dispatcher, InstrumentedType.Prepareable prepareable, int additionalVariableLength)
      Resolves a simple implementation that applies the given dispatcher.
      Parameters:
      dispatcher - The dispatcher to use.
      prepareable - A preparation of the instrumented type.
      additionalVariableLength - The amount of additional slots required in the local variable array.
      Returns:
      An implementation for the supplied dispatcher.
    • prepare

      public InstrumentedType prepare(InstrumentedType instrumentedType)
      Prepares a given instrumented type.
      Specified by:
      prepare in interface InstrumentedType.Prepareable
      Parameters:
      instrumentedType - The instrumented type in its current form.
      Returns:
      The prepared instrumented type.
    • appender

      public ByteCodeAppender appender(Implementation.Target implementationTarget)
      Creates a byte code appender that determines the implementation of the instrumented type's methods.
      Specified by:
      appender in interface Implementation
      Parameters:
      implementationTarget - The target of the current implementation.
      Returns:
      A byte code appender for implementing methods delegated to this implementation. This byte code appender is also responsible for handling methods that were added by this implementation on the call to InstrumentedType.Prepareable.prepare(InstrumentedType).