Class InstantDeserializer
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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context) Deserializes a JSON value into anInstantobject.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
-
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 anInstantobject.This method parses a string representation of a date-time in ISO 8601 format (e.g., "2023-05-01T10:15:30Z") into an
Instantobject.- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<Instant>- Parameters:
parser- the JsonParser to read the value fromcontext- context for the deserialization process- Returns:
- the deserialized
Instantobject - Throws:
IOException- if the value cannot be parsed as an ISO 8601 date-time, or if there's an issue with the parserIllegalArgumentException- if the parser is null
-