Module org.eclipse.yasson
Class DateDeserializer
java.lang.Object
org.eclipse.yasson.internal.deserializer.types.TypeDeserializer
org.eclipse.yasson.internal.deserializer.types.AbstractDateDeserializer<Date>
org.eclipse.yasson.internal.deserializer.types.DateDeserializer
- All Implemented Interfaces:
ModelDeserializer<String>
Deserializer of the
Date type.-
Field Summary
FieldsFields inherited from class org.eclipse.yasson.internal.deserializer.types.AbstractDateDeserializer
UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) DatefromInstant(Instant instant) Construct date object from an instant containing epoch millisecond.(package private) DateparseDefault(String jsonValue, Locale locale) Parse java.time date object with default formatter.(package private) DateparseWithFormatter(String jsonValue, DateTimeFormatter formatter) Parse java.time date object with provided formatter.private static DateparseWithOrWithoutZone(String jsonValue, DateTimeFormatter formatter) Methods inherited from class org.eclipse.yasson.internal.deserializer.types.AbstractDateDeserializer
deserializeStringValue, getZonedFormatterMethods inherited from class org.eclipse.yasson.internal.deserializer.types.TypeDeserializer
deserialize, deserialize, deserialize, deserializeBooleanValue, deserializeNumberValue, getType
-
Field Details
-
DEFAULT_DATE_TIME_FORMATTER
-
-
Constructor Details
-
DateDeserializer
DateDeserializer(TypeDeserializerBuilder builder)
-
-
Method Details
-
fromInstant
Description copied from class:AbstractDateDeserializerConstruct date object from an instant containing epoch millisecond. If date object supports zone offset / zone id, system default is used and warning is logged.- Specified by:
fromInstantin classAbstractDateDeserializer<Date>- Parameters:
instant- instant to construct from- Returns:
- date object
-
parseDefault
Description copied from class:AbstractDateDeserializerParse java.time date object with default formatter. Different default formatter for each date object type is used.- Specified by:
parseDefaultin classAbstractDateDeserializer<Date>- Parameters:
jsonValue- string value to parse fromlocale- annotated locale or default- Returns:
- parsed date object
-
parseWithFormatter
Description copied from class:AbstractDateDeserializerParse java.time date object with provided formatter.- Specified by:
parseWithFormatterin classAbstractDateDeserializer<Date>- Parameters:
jsonValue- string value to parse fromformatter- a formatter to use- Returns:
- parsed date object
-
parseWithOrWithoutZone
-