Package net.bytebuddy.agent.builder
Class AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.SerializationImplementation
- java.lang.Object
-
- net.bytebuddy.agent.builder.AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.SerializationImplementation
-
- All Implemented Interfaces:
InstrumentedType.Prepareable
,Implementation
- Enclosing class:
- AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory
@Enhance protected static class AgentBuilder.LambdaInstrumentationStrategy.LambdaInstanceFactory.SerializationImplementation extends java.lang.Object implements Implementation
Implements thewriteReplace
method for serializable lambda expressions.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.Implementation
Implementation.Composable, Implementation.Compound, Implementation.Context, Implementation.Simple, Implementation.SpecialMethodInvocation, Implementation.Target
-
-
Field Summary
Fields Modifier and Type Field Description private JavaConstant.MethodType
lambdaMethod
The method type of the lambda expression's functional method.private java.lang.String
lambdaMethodName
The lambda expression's functional method name.private TypeDescription
lambdaType
The lambda expression's functional type.private JavaConstant.MethodType
specializedMethod
The specialized method type of the lambda expression's functional method.private JavaConstant.MethodHandle
targetMethod
A handle that references the lambda expressions invocation target.private TypeDescription
targetType
The lambda expression's declaring type.
-
Constructor Summary
Constructors Modifier Constructor Description protected
SerializationImplementation(TypeDescription targetType, TypeDescription lambdaType, java.lang.String lambdaMethodName, JavaConstant.MethodType lambdaMethod, JavaConstant.MethodHandle targetMethod, JavaConstant.MethodType specializedMethod)
Creates a new implementation for a serializable's lambda expression'swriteReplace
method.
-
Method Summary
All 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.InstrumentedType
prepare(InstrumentedType instrumentedType)
Prepares a given instrumented type.
-
-
-
Field Detail
-
targetType
private final TypeDescription targetType
The lambda expression's declaring type.
-
lambdaType
private final TypeDescription lambdaType
The lambda expression's functional type.
-
lambdaMethodName
private final java.lang.String lambdaMethodName
The lambda expression's functional method name.
-
lambdaMethod
private final JavaConstant.MethodType lambdaMethod
The method type of the lambda expression's functional method.
-
targetMethod
private final JavaConstant.MethodHandle targetMethod
A handle that references the lambda expressions invocation target.
-
specializedMethod
private final JavaConstant.MethodType specializedMethod
The specialized method type of the lambda expression's functional method.
-
-
Constructor Detail
-
SerializationImplementation
protected SerializationImplementation(TypeDescription targetType, TypeDescription lambdaType, java.lang.String lambdaMethodName, JavaConstant.MethodType lambdaMethod, JavaConstant.MethodHandle targetMethod, JavaConstant.MethodType specializedMethod)
Creates a new implementation for a serializable's lambda expression'swriteReplace
method.- Parameters:
targetType
- The lambda expression's declaring type.lambdaType
- The lambda expression's functional type.lambdaMethodName
- The lambda expression's functional method name.lambdaMethod
- The method type of the lambda expression's functional method.targetMethod
- A handle that references the lambda expressions invocation target.specializedMethod
- The specialized method type of the lambda expression's functional method.
-
-
Method Detail
-
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)
.
-
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.
-
-