Class OffsetDateTimeDeserializer

java.lang.Object
cz.cvut.kbss.jsonld.deserialization.datetime.OffsetDateTimeDeserializer
All Implemented Interfaces:
Configurable, ValueDeserializer<OffsetDateTime>

public class OffsetDateTimeDeserializer extends Object implements ValueDeserializer<OffsetDateTime>
Deserializes values to OffsetDateTime.

If the value is a number, it is taken as the number of milliseconds since the Unix Epoch. Otherwise, it is parsed as a string.

If a datetime pattern is configured (ConfigParam.DATE_TIME_FORMAT), it is used to parse the value. Otherwise, the default ISO-based pattern is used.

  • Constructor Details

    • OffsetDateTimeDeserializer

      public OffsetDateTimeDeserializer()
  • Method Details

    • deserialize

      public OffsetDateTime deserialize(jakarta.json.JsonValue jsonNode, DeserializationContext<OffsetDateTime> ctx)
      Description copied from interface: ValueDeserializer
      Deserializes the specified JSON-LD node.
      Specified by:
      deserialize in interface ValueDeserializer<OffsetDateTime>
      Parameters:
      jsonNode - JSON-LD node to deserialize
      ctx - Deserialization context
      Returns:
      Deserialized object
    • configure

      public void configure(Configuration config)
      Description copied from interface: ValueDeserializer
      Applies the specified configuration to this deserializer.

      Should be called at the beginning of deserialization of JSON-LD content so that potential runtime changes in configuration can be reflected by the deserialization process.

      Implementations are free to apply configuration on initialization and rely on the default implementation of this method which does nothing.

      Specified by:
      configure in interface Configurable
      Specified by:
      configure in interface ValueDeserializer<OffsetDateTime>
      Parameters:
      config - Configuration to apply