Class JsonbConfiguredSerde
java.lang.Object
io.micronaut.serde.jsonb.JsonbConfiguredSerde
- All Implemented Interfaces:
Deserializer<Object>, Serde<Object>, Serializer<Object>
@Internal
@Bean(typed=JsonbConfiguredSerde.class)
public final class JsonbConfiguredSerde
extends Object
implements Serde<Object>
Bridges JSON-B config-level adapters, serializers, and deserializers into
Serde's property and element codec lookup.
Runtime introspections attach this serde through synthetic metadata when a configured JSON-B customization applies to a property or collection element.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Deserializer
Deserializer.DecoderContextNested classes/interfaces inherited from interface Serializer
Serializer.EncoderContext -
Method Summary
Modifier and TypeMethodDescriptioncreateSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) Create a new child deserializer or return this if non is necessary for the given context.createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Object> type) Create a more specific serializer for the given definition.deserialize(Decoder decoder, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) voidserialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Object> type, Object value) Serializes the given value using the passedEncoder.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Deserializer
deserializeNullable, getDefaultValueMethods inherited from interface Serializer
isAbsent, isDefault, isEmpty
-
Method Details
-
createSpecific
public Serializer<Object> createSpecific(Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Object> type) throws SerdeException Description copied from interface:SerializerCreate a more specific serializer for the given definition.- Specified by:
createSpecificin interfaceSerializer<Object>- Parameters:
context- The encoder contexttype- The type definition including any annotation metadata- Returns:
- The more specific serializer
- Throws:
SerdeException
-
createSpecific
public Deserializer<Object> createSpecific(Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) throws SerdeException Description copied from interface:DeserializerCreate a new child deserializer or return this if non is necessary for the given context.- Specified by:
createSpecificin interfaceDeserializer<Object>- Parameters:
context- The decoder contexttype- The context, including any annotation metadata and type information to narrow the deserializer type- Returns:
- An instance of the same type of deserializer
- Throws:
SerdeException
-
serialize
public void serialize(Encoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends Object> type, Object value) throws IOException Description copied from interface:SerializerSerializes the given value using the passedEncoder.- Specified by:
serializein interfaceSerializer<Object>- Parameters:
encoder- The encoder to usecontext- The encoder context, nevernulltype- Models the generic type of the valuevalue- The value to serialize, nevernull. Callers should encode null values directly.- Throws:
IOException- If an error occurs during serialization
-
deserialize
public Object deserialize(Decoder decoder, Deserializer.DecoderContext context, io.micronaut.core.type.Argument<? super Object> type) throws IOException Description copied from interface:Deserializer- Specified by:
deserializein interfaceDeserializer<Object>- Parameters:
decoder- The decoder, nevernullcontext- The decoder context, nevernulltype- The generic type to be deserialized- Returns:
- The deserialized object, never
null. UseDeserializer.deserializeNullable(Decoder, DecoderContext, Argument)when the decoder value can benull. - Throws:
IOException- If an error occurs during deserialization of the object
-