Package io.micronaut.serde.util
Interface CustomizableSerializer<T>
- Type Parameters:
T
- The serializer type
- All Superinterfaces:
Serializer<T>
- All Known Implementing Classes:
ObjectArraySerde
,ObjectSerializer
The type of serializer that requires a specific implementation by calling
Serializer.createSpecific(Serializer.EncoderContext, Argument)
.- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.serde.Serializer
Serializer.EncoderContext
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
isAbsent
(Serializer.EncoderContext context, T value) Used forJsonInclude.Include#NON_ABSENT
checking.default boolean
isEmpty
(Serializer.EncoderContext context, T value) Used forJsonInclude.Include#NON_EMPTY
checking.default void
serialize
(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) Serializes the given value using the passedEncoder
.Methods inherited from interface io.micronaut.serde.Serializer
createSpecific
-
Method Details
-
serialize
default 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 passedEncoder
.- Specified by:
serialize
in interfaceSerializer<T>
- Parameters:
encoder
- The encoder to usecontext
- The encoder context, nevernull
type
- Models the generic type of the valuevalue
- The value, can benull
- Throws:
IOException
- If an error occurs during serialization
-
isEmpty
Description copied from interface:Serializer
Used forJsonInclude.Include#NON_EMPTY
checking.- Specified by:
isEmpty
in interfaceSerializer<T>
- Parameters:
context
- The encoder contextvalue
- The check to check- Returns:
- Return
true
if the value is empty
-
isAbsent
Description copied from interface:Serializer
Used forJsonInclude.Include#NON_ABSENT
checking.- Specified by:
isAbsent
in interfaceSerializer<T>
- Parameters:
context
- The encoder contextvalue
- The value to check- Returns:
- Return
true
if the value is absent
-