Package net.bytebuddy.implementation
Class Implementation.Simple
java.lang.Object
net.bytebuddy.implementation.Implementation.Simple
- All Implemented Interfaces:
InstrumentedType.Prepareable
,Implementation
- Enclosing interface:
Implementation
A simple implementation that does not register any members with the instrumented type.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A dispatcher for a simpleImplementation
, typically implemented as a lambda expression.protected static class
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
FieldsModifier and TypeFieldDescriptionprivate final ByteCodeAppender
The byte code appender to emmit.private static final int
Indicates that no additional local variable slots are required. -
Constructor Summary
ConstructorsConstructorDescriptionSimple
(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
Modifier and TypeMethodDescriptionappender
(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.prepare
(InstrumentedType instrumentedType) Prepares a given instrumented type.
-
Field Details
-
NO_ADDITIONAL_VARIABLES
private static final int NO_ADDITIONAL_VARIABLESIndicates that no additional local variable slots are required.- See Also:
-
byteCodeAppender
The byte code appender to emmit.
-
-
Constructor Details
-
Simple
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
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
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
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
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)
.
-