Class AbstractDateTimeDeserializer<T>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.time.ZoneId UTC
      Default zone id.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      T deserialize​(java.lang.String jsonValue, Unmarshaller unmarshaller, java.lang.reflect.Type rtType)
      Convert string value to object.
      protected abstract T fromInstant​(java.time.Instant instant)
      Construct date object from an instant containing epoch millisecond.
      protected JsonbDateFormatter getJsonbDateFormatter​(JsonbContext context)
      Returns registered deserialization jsonb date formatter.
      protected java.time.format.DateTimeFormatter getZonedFormatter​(java.time.format.DateTimeFormatter formatter)
      Append UTC zone in case zone is not set on formatter.
      protected abstract T parseDefault​(java.lang.String jsonValue, java.util.Locale locale)
      Parse java.time date object with default formatter.
      protected abstract T parseWithFormatter​(java.lang.String jsonValue, java.time.format.DateTimeFormatter formatter)
      Parse java.time date object with provided formatter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • UTC

        public static final java.time.ZoneId UTC
        Default zone id.
    • Constructor Detail

      • AbstractDateTimeDeserializer

        public AbstractDateTimeDeserializer​(java.lang.Class<T> clazz,
                                            Customization customization)
        Creates an instance.
        Parameters:
        clazz - Class to create deserializer for.
        customization - Model customization.
    • Method Detail

      • deserialize

        public T deserialize​(java.lang.String jsonValue,
                             Unmarshaller unmarshaller,
                             java.lang.reflect.Type rtType)
        Description copied from class: AbstractValueTypeDeserializer
        Convert string value to object.
        Overrides:
        deserialize in class AbstractValueTypeDeserializer<T>
        Parameters:
        jsonValue - Json value.
        unmarshaller - Unmarshaller instance.
        rtType - Runtime type.
        Returns:
        Deserialized object.
      • getJsonbDateFormatter

        protected JsonbDateFormatter getJsonbDateFormatter​(JsonbContext context)
        Returns registered deserialization jsonb date formatter.
        Parameters:
        context - context
        Returns:
        date formatter
      • getZonedFormatter

        protected java.time.format.DateTimeFormatter getZonedFormatter​(java.time.format.DateTimeFormatter formatter)
        Append UTC zone in case zone is not set on formatter.
        Parameters:
        formatter - formatter
        Returns:
        zoned formatter
      • fromInstant

        protected abstract T fromInstant​(java.time.Instant instant)
        Construct date object from an instant containing epoch millisecond. If date object supports zone offset / zone id, system default is used and warning is logged.
        Parameters:
        instant - instant to construct from
        Returns:
        date object
      • parseDefault

        protected abstract T parseDefault​(java.lang.String jsonValue,
                                          java.util.Locale locale)
        Parse java.time date object with default formatter. Different default formatter for each date object type is used.
        Parameters:
        jsonValue - string value to parse from
        locale - annotated locale or default
        Returns:
        parsed date object
      • parseWithFormatter

        protected abstract T parseWithFormatter​(java.lang.String jsonValue,
                                                java.time.format.DateTimeFormatter formatter)
        Parse java.time date object with provided formatter.
        Parameters:
        jsonValue - string value to parse from
        formatter - a formatter to use
        Returns:
        parsed date object