public class ObjectArraySerde extends java.lang.Object implements NullableSerde<java.lang.Object[]>, Serde<java.lang.Object[]>
Serializer.EncoderContext
Deserializer.DecoderContext
Constructor and Description |
---|
ObjectArraySerde() |
Modifier and Type | Method and Description |
---|---|
Deserializer<java.lang.Object[]> |
createSpecific(io.micronaut.core.type.Argument<? super java.lang.Object[]> context,
Deserializer.DecoderContext decoderContext)
Create a new child deserializer or return this if non is necessary for the given context.
|
java.lang.Object[] |
deserializeNonNull(Decoder decoder,
Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<? super java.lang.Object[]> type)
A method that is invoked when the value is known not to be null.
|
protected Deserializer<?> |
findDeserializer(Deserializer.DecoderContext decoderContext,
io.micronaut.core.type.Argument<?> componentType)
Resolves the deserializer.
|
protected io.micronaut.core.type.Argument<java.lang.Object> |
getComponentType(io.micronaut.core.type.Argument<? super java.lang.Object[]> type)
resolves the component type.
|
boolean |
isEmpty(java.lang.Object[] value)
Used for
JsonInclude.Include#NON_EMPTY checking. |
void |
serialize(Encoder encoder,
Serializer.EncoderContext context,
java.lang.Object[] value,
io.micronaut.core.type.Argument<? extends java.lang.Object[]> type)
Serializes the given value using the passed
Encoder . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createSpecific, isAbsent
allowNull, deserialize
getDefaultValue
public Deserializer<java.lang.Object[]> createSpecific(io.micronaut.core.type.Argument<? super java.lang.Object[]> context, Deserializer.DecoderContext decoderContext) throws SerdeException
Deserializer
createSpecific
in interface Deserializer<java.lang.Object[]>
context
- The context, including any annotation metadata and type information to narrow the deserializer typedecoderContext
- The decoder contextSerdeException
public java.lang.Object[] deserializeNonNull(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super java.lang.Object[]> type) throws java.io.IOException
NullableDeserializer
deserializeNonNull
in interface NullableDeserializer<java.lang.Object[]>
decoder
- The decoderdecoderContext
- The decoder contexttype
- The typejava.io.IOException
- if something goes wrong during deserializationprotected io.micronaut.core.type.Argument<java.lang.Object> getComponentType(io.micronaut.core.type.Argument<? super java.lang.Object[]> type)
type
- The component typeprotected Deserializer<?> findDeserializer(Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<?> componentType) throws SerdeException
decoderContext
- The decoder contextcomponentType
- The component typeSerdeException
- if no deserializer is available.public void serialize(Encoder encoder, Serializer.EncoderContext context, java.lang.Object[] value, io.micronaut.core.type.Argument<? extends java.lang.Object[]> type) throws java.io.IOException
Serializer
Encoder
.serialize
in interface Serializer<java.lang.Object[]>
encoder
- The encoder to usecontext
- The encoder context, never null
value
- The value, can be null
type
- Models the generic type of the valuejava.io.IOException
- If an error occurs during serializationpublic boolean isEmpty(java.lang.Object[] value)
Serializer
JsonInclude.Include#NON_EMPTY
checking.isEmpty
in interface Serializer<java.lang.Object[]>
value
- The check to checktrue
if the value is empty