Module org.eclipse.yasson
Class CyclicReferenceSerializer
java.lang.Object
org.eclipse.yasson.internal.serializer.CyclicReferenceSerializer
- All Implemented Interfaces:
ModelSerializer
Solution for cyclic references in serialization.
This approach helps us to avoid creation of multiple serializers for the same type.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
serialize
(Object value, jakarta.json.stream.JsonGenerator generator, SerializationContextImpl context) Serialize provided value or delegate serialization to the next serializer.
-
Field Details
-
type
-
delegate
-
-
Constructor Details
-
CyclicReferenceSerializer
CyclicReferenceSerializer(Type type)
-
-
Method Details
-
serialize
public void serialize(Object value, jakarta.json.stream.JsonGenerator generator, SerializationContextImpl context) Description copied from interface:ModelSerializer
Serialize provided value or delegate serialization to the next serializer.- Specified by:
serialize
in interfaceModelSerializer
- Parameters:
value
- value to be serializedgenerator
- json generatorcontext
- serialization context
-