Class ZonedDateTimeTypeDeserializer
- java.lang.Object
-
- org.eclipse.yasson.internal.serializer.AbstractValueTypeDeserializer<T>
-
- org.eclipse.yasson.internal.serializer.AbstractDateTimeDeserializer<java.time.ZonedDateTime>
-
- org.eclipse.yasson.internal.serializer.ZonedDateTimeTypeDeserializer
-
- All Implemented Interfaces:
javax.json.bind.serializer.JsonbDeserializer<java.time.ZonedDateTime>
public class ZonedDateTimeTypeDeserializer extends AbstractDateTimeDeserializer<java.time.ZonedDateTime>
Deserializer forZonedDateTime
type.
-
-
Field Summary
-
Fields inherited from class org.eclipse.yasson.internal.serializer.AbstractDateTimeDeserializer
UTC
-
-
Constructor Summary
Constructors Constructor Description ZonedDateTimeTypeDeserializer(Customization customization)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.time.ZonedDateTime
fromInstant(java.time.Instant instant)
fromInstant is called only in caseJsonbDateFormat
is TIME_IN_MILLIS, which doesn't make much sense for usage with ZonedDateTime.protected java.time.ZonedDateTime
parseDefault(java.lang.String jsonValue, java.util.Locale locale)
Parse java.time date object with default formatter.protected java.time.ZonedDateTime
parseWithFormatter(java.lang.String jsonValue, java.time.format.DateTimeFormatter formatter)
Parse java.time date object with provided formatter.-
Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractDateTimeDeserializer
deserialize, getJsonbDateFormatter, getZonedFormatter
-
Methods inherited from class org.eclipse.yasson.internal.serializer.AbstractValueTypeDeserializer
deserialize, getCustomization, getPropertyType
-
-
-
-
Constructor Detail
-
ZonedDateTimeTypeDeserializer
public ZonedDateTimeTypeDeserializer(Customization customization)
Creates an instance.- Parameters:
customization
- Model customization.
-
-
Method Detail
-
fromInstant
protected java.time.ZonedDateTime fromInstant(java.time.Instant instant)
fromInstant is called only in caseJsonbDateFormat
is TIME_IN_MILLIS, which doesn't make much sense for usage with ZonedDateTime.- Specified by:
fromInstant
in classAbstractDateTimeDeserializer<java.time.ZonedDateTime>
- Parameters:
instant
- instant to construct from- Returns:
- date object
-
parseDefault
protected java.time.ZonedDateTime parseDefault(java.lang.String jsonValue, java.util.Locale locale)
Description copied from class:AbstractDateTimeDeserializer
Parse java.time date object with default formatter. Different default formatter for each date object type is used.- Specified by:
parseDefault
in classAbstractDateTimeDeserializer<java.time.ZonedDateTime>
- Parameters:
jsonValue
- string value to parse fromlocale
- annotated locale or default- Returns:
- parsed date object
-
parseWithFormatter
protected java.time.ZonedDateTime parseWithFormatter(java.lang.String jsonValue, java.time.format.DateTimeFormatter formatter)
Description copied from class:AbstractDateTimeDeserializer
Parse java.time date object with provided formatter.- Specified by:
parseWithFormatter
in classAbstractDateTimeDeserializer<java.time.ZonedDateTime>
- Parameters:
jsonValue
- string value to parse fromformatter
- a formatter to use- Returns:
- parsed date object
-
-