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

      @NonNull public final T deserialize(@NonNull @NonNull Decoder decoder, @NonNull @NonNull Deserializer.DecoderContext decoderContext, @NonNull @NonNull 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 Deserializer.
      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 or null only if Deserializer.allowNull() returns true
      Throws:
      IOException - If an error occurs during deserialization of the object
    • serialize

      public void serialize(@NonNull @NonNull Encoder encoder, @NonNull @NonNull Serializer.EncoderContext context, @NonNull @NonNull 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, can be null
      Throws:
      IOException - If an error occurs during serialization
    • doDeserializeNonNull

      @NonNull protected abstract T doDeserializeNonNull(@NonNull @NonNull OracleJdbcJsonParserDecoder decoder, @NonNull @NonNull Deserializer.DecoderContext decoderContext, @NonNull @NonNull 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, @NonNull 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