Class CustomizedObjectSerializer<T>

Type Parameters:
T - The type to serialize
All Implemented Interfaces:

@Internal public class CustomizedObjectSerializer<T> extends Object implements Serializer<T>
Fallback Serializer for general Object values. For deserialization, deserializes to standard types like Number, String, Boolean, Map and List.

This class is used in multiple scenarios:

  • When the user has an Object property in a serializable bean.
  • When the user explicitly calls JsonMapper.writeValue(, java.lang.Object)(gen, Object .class)
  • Constructor Details

    • CustomizedObjectSerializer

      public CustomizedObjectSerializer(<Object> serBean)
  • Method Details

    • serialize

      public final void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) throws IOException
      Description copied from interface: Serializer
      Serializes the given value using the passed Encoder.
      Specified by:
      serialize in interface Serializer<T>
      encoder - The encoder to use
      context - The encoder context, never null
      type - Models the generic type of the value
      value - The value, can be null
      IOException - If an error occurs during serialization
    • getWriteProperties

      @NonNull protected @NonNull List<<Object,Object>> getWriteProperties(<Object> serBean)
      Obtains the write properties for this serializer.
      serBean - The serialization bean.
      The write properties, never null