Class AbstractOracleJsonSerde<T>

java.lang.Object
io.micronaut.serde.oracle.jdbc.json.serde.AbstractOracleJsonSerde<T>
Type Parameters:
T - the type being deserialized
All Implemented Interfaces:
Deserializer<T>, Serde<T>, Serializer<T>
Direct Known Subclasses:
OracleJsonBinarySerde, OracleJsonLocaleDateSerde, OracleJsonLocaleDateTimeSerde, OracleJsonLocaleTimeSerde, OracleJsonOffsetDateTimeSerde, OracleJsonZonedDateTimeSerde

@Internal public abstract class AbstractOracleJsonSerde<T> extends Object implements Serde<T>
Abstract serializer/deserializer that needs to access Oracle JSON decoder.
  • Constructor Details

    • AbstractOracleJsonSerde

      public AbstractOracleJsonSerde()
  • Method Details

    • deserialize

      public final T deserialize(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super T> type) throws IOException
      Description copied from interface: Deserializer
      Deserializes from the current state of the Decoder an object of type T.
      Specified by:
      deserialize in interface Deserializer<T>
      Parameters:
      decoder - The decoder, never null
      decoderContext - The decoder context, never null
      type - The generic type to be deserialized
      Returns:
      The deserialized object, never null. Use Deserializer.deserializeNullable(Decoder, DecoderContext, Argument) when the decoder value can be null.
      Throws:
      IOException - If an error occurs during deserialization of the object
    • deserializeNullable

      public final @Nullable T deserializeNullable(Decoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super T> type) throws IOException
      Description copied from interface: Deserializer
      Deserializes from the current state of the Decoder an object of type T. If the decoder value is null, this must be permitted. By default, in this case, this method will return null.
      Specified by:
      deserializeNullable in interface Deserializer<T>
      Parameters:
      decoder - The decoder, never null
      decoderContext - The decoder context, never null
      type - The generic type to be deserialized
      Returns:
      The deserialized object or null
      Throws:
      IOException - If an error occurs during deserialization of the object
    • serialize

      public 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>
      Parameters:
      encoder - The encoder to use
      context - The encoder context, never null
      type - Models the generic type of the value
      value - The value to serialize, never null. Callers should encode null values directly.
      Throws:
      IOException - If an error occurs during serialization
    • doDeserializeNonNull

      protected abstract T doDeserializeNonNull(OracleJdbcJsonParserDecoder decoder, Deserializer.DecoderContext decoderContext, io.micronaut.core.type.Argument<? super T> type) throws IOException
      Deserializes object using OracleJdbcJsonParserDecoder.
      Parameters:
      decoder - the Oracle JSON decoder
      decoderContext - the decoder context
      type - the type being deserialized
      Returns:
      the deserialized instance of given type
      Throws:
      IOException - if an unrecoverable error occurs
    • doSerializeNonNull

      protected abstract void doSerializeNonNull(OracleJdbcJsonGeneratorEncoder encoder, Serializer.EncoderContext context, io.micronaut.core.type.Argument<? extends T> type, T value) throws IOException
      Serializes non null value.
      Parameters:
      encoder - the encoder
      context - the encoder context
      type - the type of object being serialized
      value - the value being serialized
      Throws:
      IOException - if an unrecoverable error occurs
    • getDefault

      protected abstract Serde<T> getDefault()
      Returns:
      The default behaviour