java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<Instant>
dev.jcputney.elearning.parser.input.common.serialization.InstantDeserializer
All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider

public class InstantDeserializer extends com.fasterxml.jackson.databind.JsonDeserializer<Instant>
Custom deserializer for Instant objects, allowing ISO 8601 date-time strings to be parsed into Instant instances.

This deserializer supports date-time formats with timezone information (e.g., "2023-05-01T10:15:30Z").

  • Nested Class Summary

    Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer

    com.fasterxml.jackson.databind.JsonDeserializer.None
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor for the deserializer.
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context)
    Deserializes a JSON value into an Instant object.

    Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer

    deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • InstantDeserializer

      public InstantDeserializer()
      Default constructor for the deserializer.
  • Method Details

    • deserialize

      public Instant deserialize(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context) throws IOException
      Deserializes a JSON value into an Instant object.

      This method parses a string representation of a date-time in ISO 8601 format (e.g., "2023-05-01T10:15:30Z") into an Instant object.

      Specified by:
      deserialize in class com.fasterxml.jackson.databind.JsonDeserializer<Instant>
      Parameters:
      parser - the JsonParser to read the value from
      context - context for the deserialization process
      Returns:
      the deserialized Instant object
      Throws:
      IOException - if the value cannot be parsed as an ISO 8601 date-time, or if there's an issue with the parser
      IllegalArgumentException - if the parser is null