Class ObjectTypeSerializer

java.lang.Object
org.eclipse.yasson.internal.serializer.types.ObjectTypeSerializer
All Implemented Interfaces:
ModelSerializer

public class ObjectTypeSerializer extends Object
Object type serializer. Dynamically resolves the serialized type based on the serialized instance class.
  • Method Details

    • addSpecificSerializer

      public void addSpecificSerializer(Class<?> clazz, ModelSerializer modelSerializer)
      Add serializer to the cache.
      Parameters:
      clazz - class of the serializer
      modelSerializer - model serializer bound to the class
    • 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 interface ModelSerializer
      Parameters:
      value - value to be serialized
      generator - json generator
      context - serialization context