Package net.bytebuddy.implementation
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 java.lang.Object implements Implementation
A simple implementation that does not register any members with the instrumented type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Implementation.Simple.Dispatcher
A dispatcher for a simpleImplementation
, typically implemented as a lambda expression.protected static class
Implementation.Simple.ForDispatcher
AByteCodeAppender
for a dispatcher.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType.Prepareable
InstrumentedType.Prepareable.NoOp
-
-
Field Summary
Fields Modifier and Type Field Description private ByteCodeAppender
byteCodeAppender
The byte code appender to emmit.private static int
NO_ADDITIONAL_VARIABLES
Indicates that no additional local variable slots are required.
-
Constructor Summary
Constructors Constructor Description Simple(ByteCodeAppender... byteCodeAppender)
Creates a new simple implementation for the given byte code appenders.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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteCodeAppender
appender(Implementation.Target implementationTarget)
Creates a byte code appender that determines the implementation of the instrumented type's methods.static Implementation
of(Implementation.Simple.Dispatcher dispatcher)
Resolves a simple implementation that applies the given dispatcher without defining additional local variables.static Implementation
of(Implementation.Simple.Dispatcher dispatcher, int additionalVariableLength)
Resolves a simple implementation that applies the given dispatcher.static Implementation
of(Implementation.Simple.Dispatcher dispatcher, InstrumentedType.Prepareable prepareable)
Resolves a simple implementation that applies the given dispatcher without defining additional local variables.static Implementation
of(Implementation.Simple.Dispatcher dispatcher, InstrumentedType.Prepareable prepareable, int additionalVariableLength)
Resolves a simple implementation that applies the given dispatcher.InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.
-
-
-
Field Detail
-
NO_ADDITIONAL_VARIABLES
private static final int NO_ADDITIONAL_VARIABLES
Indicates that no additional local variable slots are required.- See Also:
- Constant Field Values
-
byteCodeAppender
private final ByteCodeAppender byteCodeAppender
The byte code appender to emmit.
-
-
Constructor Detail
-
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 Detail
-
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
public static Implementation of(Implementation.Simple.Dispatcher dispatcher, InstrumentedType.Prepareable prepareable)
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 interfaceInstrumentedType.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 interfaceImplementation
- 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)
.
-
-