Module org.eclipse.yasson
Class InstantDeserializer
java.lang.Object
org.eclipse.yasson.internal.deserializer.types.TypeDeserializer
org.eclipse.yasson.internal.deserializer.types.AbstractDateDeserializer<Instant>
org.eclipse.yasson.internal.deserializer.types.InstantDeserializer
- All Implemented Interfaces:
ModelDeserializer<String>
Deserializer of the
Instant
type.-
Field Summary
FieldsFields inherited from class org.eclipse.yasson.internal.deserializer.types.AbstractDateDeserializer
UTC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Instant
fromInstant
(Instant instant) Construct date object from an instant containing epoch millisecond.protected Instant
parseDefault
(String jsonValue, Locale locale) Parse java.time date object with default formatter.protected Instant
parseWithFormatter
(String jsonValue, DateTimeFormatter formatter) Parse java.time date object with provided formatter.Methods inherited from class org.eclipse.yasson.internal.deserializer.types.AbstractDateDeserializer
deserializeStringValue, getZonedFormatter
Methods inherited from class org.eclipse.yasson.internal.deserializer.types.TypeDeserializer
deserialize, deserialize, deserialize, deserializeBooleanValue, deserializeNumberValue, getType
-
Field Details
-
DEFAULT_FORMATTER
-
-
Constructor Details
-
InstantDeserializer
InstantDeserializer(TypeDeserializerBuilder builder)
-
-
Method Details
-
fromInstant
Description copied from class:AbstractDateDeserializer
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.- Specified by:
fromInstant
in classAbstractDateDeserializer<Instant>
- Parameters:
instant
- instant to construct from- Returns:
- date object
-
parseDefault
Description copied from class:AbstractDateDeserializer
Parse java.time date object with default formatter. Different default formatter for each date object type is used.- Specified by:
parseDefault
in classAbstractDateDeserializer<Instant>
- Parameters:
jsonValue
- string value to parse fromlocale
- annotated locale or default- Returns:
- parsed date object
-
parseWithFormatter
Description copied from class:AbstractDateDeserializer
Parse java.time date object with provided formatter.- Specified by:
parseWithFormatter
in classAbstractDateDeserializer<Instant>
- Parameters:
jsonValue
- string value to parse fromformatter
- a formatter to use- Returns:
- parsed date object
-