@Internal public class CustomizedObjectSerializer<T> extends java.lang.Object implements Serializer<T>
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:
Object
property in a serializable bean.JsonMapper.writeValue(java.io.OutputStream, java.lang.Object)
(gen,
Object
.class)
Serializer.EncoderContext
Constructor and Description |
---|
CustomizedObjectSerializer(io.micronaut.serde.support.serializers.SerBean<java.lang.Object> serBean) |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<io.micronaut.serde.support.serializers.SerBean.SerProperty<java.lang.Object,java.lang.Object>> |
getWriteProperties(io.micronaut.serde.support.serializers.SerBean<java.lang.Object> serBean)
Obtains the write properties for this serializer.
|
void |
serialize(Encoder encoder,
Serializer.EncoderContext context,
io.micronaut.core.type.Argument<? extends T> type,
T value)
Serializes the given value using the passed
Encoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSpecific, isAbsent, isEmpty
public CustomizedObjectSerializer(io.micronaut.serde.support.serializers.SerBean<java.lang.Object> serBean)
public final void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) throws java.io.IOException
Serializer
Encoder
.serialize
in interface Serializer<T>
encoder
- The encoder to usecontext
- The encoder context, never null
type
- Models the generic type of the valuevalue
- The value, can be null
java.io.IOException
- If an error occurs during serialization@NonNull protected java.util.List<io.micronaut.serde.support.serializers.SerBean.SerProperty<java.lang.Object,java.lang.Object>> getWriteProperties(io.micronaut.serde.support.serializers.SerBean<java.lang.Object> serBean)
serBean
- The serialization bean.null