Interface AbstractFunctionalInterfaceWriter
- All Known Implementing Classes:
StaticTypesLambdaWriter,StaticTypesMethodReferenceExpressionWriter
public interface AbstractFunctionalInterfaceWriter
Shared bytecode and deserialization support for statically-compiled functional interface implementations,
including both lambdas and method references.
- Since:
- 3.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordCompile-time identity of one serialized functional-interface target used by$deserializeLambda$dispatch. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddDeserializeDispatcherEntry(WriterController controller, Parameter[] deserializeMethodParameters, AbstractFunctionalInterfaceWriter.SerializedLambdaFingerprint serializedLambdaFingerprint, MethodNode helperMethod) Registers a deserialization guard that routes a serialized lambda back to its helper method.default ClassNodeconvertParameterType(ClassNode targetType, ClassNode parameterType, ClassNode inferredType) Reconciles the inferred lambda parameter type with the target functional-interface parameter type.default ParametercreateCapturedReceiverParameter(ClassNode receiverType, String parameterName) Creates the synthetic parameter that carries a captured receiver into a generated lambda factory.default Parameter[]Creates the parameter list for a synthetic$deserializeLambda$helper.default StringcreateFunctionalInterfaceFactoryDescriptor(ClassNode functionalType, Parameter[] capturedParameters) Returns the invoked type descriptor used to create the functional-interface instance.default StringcreateMethodDescriptor(ClassNode returnType, Parameter[] parameters) Returns the JVM method descriptor for the supplied return type and parameters.default StringcreateMethodDescriptor(MethodNode method) Returns the JVM method descriptor for the supplied method node.createSerializedLambdaFingerprint(String samMethodDescriptor, ClassNode capturingClass, int implMethodKind, ClassNode implClassNode, MethodNode implMethodNode, Parameter[] implMethodParameters, ClassNode functionalType, MethodNode abstractMethod, int capturedArgumentCount) Builds the serialized-lambda fingerprint used to dispatch deserialization helpers.default voidwriteFunctionalInterfaceIndy(org.objectweb.asm.MethodVisitor methodVisitor, String samMethodName, String invokedTypeDescriptor, String samMethodDescriptor, int implMethodKind, ClassNode implClassNode, MethodNode implMethodNode, Parameter[] implMethodParameters, boolean serializable) Emits the bootstrap invocation for a functional-interface implementation without additional marker interfaces.default voidwriteFunctionalInterfaceIndy(org.objectweb.asm.MethodVisitor methodVisitor, String samMethodName, String invokedTypeDescriptor, String samMethodDescriptor, int implMethodKind, ClassNode implClassNode, MethodNode implMethodNode, Parameter[] implMethodParameters, boolean serializable, ClassNode[] markers) Marker-aware variant for intersection-cast targets such as(Runnable & Cloneable) () -> ....
-
Method Details
-
writeFunctionalInterfaceIndy
default void writeFunctionalInterfaceIndy(org.objectweb.asm.MethodVisitor methodVisitor, String samMethodName, String invokedTypeDescriptor, String samMethodDescriptor, int implMethodKind, ClassNode implClassNode, MethodNode implMethodNode, Parameter[] implMethodParameters, boolean serializable) Emits the bootstrap invocation for a functional-interface implementation without additional marker interfaces. -
writeFunctionalInterfaceIndy
default void writeFunctionalInterfaceIndy(org.objectweb.asm.MethodVisitor methodVisitor, String samMethodName, String invokedTypeDescriptor, String samMethodDescriptor, int implMethodKind, ClassNode implClassNode, MethodNode implMethodNode, Parameter[] implMethodParameters, boolean serializable, ClassNode[] markers) Marker-aware variant for intersection-cast targets such as(Runnable & Cloneable) () -> .... Markers are threaded throughLambdaMetafactory.altMetafactoryviaFLAG_MARKERSso the generated lambda implements every component interface at runtime.- Since:
- 6.0.0
-
createMethodDescriptor
Returns the JVM method descriptor for the supplied method node. -
createMethodDescriptor
Returns the JVM method descriptor for the supplied return type and parameters. -
createFunctionalInterfaceFactoryDescriptor
default String createFunctionalInterfaceFactoryDescriptor(ClassNode functionalType, Parameter[] capturedParameters) Returns the invoked type descriptor used to create the functional-interface instance. -
createCapturedReceiverParameter
Creates the synthetic parameter that carries a captured receiver into a generated lambda factory. -
convertParameterType
default ClassNode convertParameterType(ClassNode targetType, ClassNode parameterType, ClassNode inferredType) Reconciles the inferred lambda parameter type with the target functional-interface parameter type. -
createSerializedLambdaFingerprint
default AbstractFunctionalInterfaceWriter.SerializedLambdaFingerprint createSerializedLambdaFingerprint(String samMethodDescriptor, ClassNode capturingClass, int implMethodKind, ClassNode implClassNode, MethodNode implMethodNode, Parameter[] implMethodParameters, ClassNode functionalType, MethodNode abstractMethod, int capturedArgumentCount) Builds the serialized-lambda fingerprint used to dispatch deserialization helpers. -
addDeserializeDispatcherEntry
default void addDeserializeDispatcherEntry(WriterController controller, Parameter[] deserializeMethodParameters, AbstractFunctionalInterfaceWriter.SerializedLambdaFingerprint serializedLambdaFingerprint, MethodNode helperMethod) Registers a deserialization guard that routes a serialized lambda back to its helper method. -
createDeserializeMethodParameters
Creates the parameter list for a synthetic$deserializeLambda$helper.
-