public class InstantDeserializer<T extends Temporal> extends JSR310DateTimeDeserializerBase<T>
Modifier and Type | Class and Description |
---|---|
static class |
InstantDeserializer.FromDecimalArguments |
static class |
InstantDeserializer.FromIntegerArguments |
Modifier and Type | Field and Description |
---|---|
protected Boolean |
_adjustToContextTZOverride
Flag for
JsonFormat.Feature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE |
protected BiFunction<T,ZoneId,T> |
adjust |
protected Function<InstantDeserializer.FromIntegerArguments,T> |
fromMilliseconds |
protected Function<InstantDeserializer.FromDecimalArguments,T> |
fromNanoseconds |
static InstantDeserializer<Instant> |
INSTANT |
static InstantDeserializer<OffsetDateTime> |
OFFSET_DATE_TIME |
protected Function<TemporalAccessor,T> |
parsedToValue |
protected boolean |
replaceZeroOffsetAsZ
In case of vanilla `Instant` we seem to need to translate "+0000 | +00:00 | +00"
timezone designator into plain "Z" for some reason; see
[jackson-modules-java8#18] for more info
|
static InstantDeserializer<ZonedDateTime> |
ZONED_DATE_TIME |
_formatter, _isLenient
Modifier | Constructor and Description |
---|---|
protected |
InstantDeserializer(Class<T> supportedType,
DateTimeFormatter formatter,
Function<TemporalAccessor,T> parsedToValue,
Function<InstantDeserializer.FromIntegerArguments,T> fromMilliseconds,
Function<InstantDeserializer.FromDecimalArguments,T> fromNanoseconds,
BiFunction<T,ZoneId,T> adjust,
boolean replaceZeroOffsetAsZ) |
protected |
InstantDeserializer(InstantDeserializer<T> base,
Boolean adjustToContextTimezoneOverride) |
protected |
InstantDeserializer(InstantDeserializer<T> base,
DateTimeFormatter f) |
Modifier and Type | Method and Description |
---|---|
protected int |
_countPeriods(String str) |
protected T |
_fromDecimal(com.fasterxml.jackson.databind.DeserializationContext context,
BigDecimal value) |
protected T |
_fromLong(com.fasterxml.jackson.databind.DeserializationContext context,
long timestamp) |
protected <R> R |
_handleDateTimeException(com.fasterxml.jackson.databind.DeserializationContext context,
DateTimeException e0,
String value) |
protected <R> R |
_handleUnexpectedToken(com.fasterxml.jackson.databind.DeserializationContext context,
com.fasterxml.jackson.core.JsonParser parser,
com.fasterxml.jackson.core.JsonToken... expTypes) |
protected <R> R |
_handleUnexpectedToken(com.fasterxml.jackson.databind.DeserializationContext context,
com.fasterxml.jackson.core.JsonParser parser,
String message,
Object... args) |
protected DateTimeException |
_peelDTE(DateTimeException e)
Helper method used to peel off spurious wrappings of DateTimeException
|
protected <BOGUS> BOGUS |
_reportWrongToken(com.fasterxml.jackson.databind.DeserializationContext context,
com.fasterxml.jackson.core.JsonToken exp,
String unit) |
protected <BOGUS> BOGUS |
_reportWrongToken(com.fasterxml.jackson.core.JsonParser parser,
com.fasterxml.jackson.databind.DeserializationContext context,
com.fasterxml.jackson.core.JsonToken... expTypes) |
com.fasterxml.jackson.databind.JsonDeserializer<T> |
createContextual(com.fasterxml.jackson.databind.DeserializationContext ctxt,
com.fasterxml.jackson.databind.BeanProperty property) |
T |
deserialize(com.fasterxml.jackson.core.JsonParser parser,
com.fasterxml.jackson.databind.DeserializationContext context) |
Object |
deserializeWithType(com.fasterxml.jackson.core.JsonParser parser,
com.fasterxml.jackson.databind.DeserializationContext context,
com.fasterxml.jackson.databind.jsontype.TypeDeserializer typeDeserializer) |
protected boolean |
shouldAdjustToContextTimezone(com.fasterxml.jackson.databind.DeserializationContext context) |
protected InstantDeserializer<T> |
withDateFormat(DateTimeFormatter dtf) |
protected InstantDeserializer<T> |
withLeniency(Boolean leniency) |
_failForNotLenient, _throwNoNumericTimestampNeedTimeZone, isLenient
deserialize, getEmptyAccessPattern, getNullAccessPattern, supportsUpdate
_byteOverflow, _coercedTypeDesc, _coerceEmptyString, _coerceIntegral, _coerceNullToken, _coerceTextualNull, _deserializeFromArray, _deserializeFromEmpty, _deserializeWrappedValue, _failDoubleToIntCoercion, _findNullProvider, _hasTextualNull, _intOverflow, _isEmptyOrTextualNull, _isIntNumber, _isNaN, _isNegInf, _isPosInf, _neitherNull, _nonNullNumber, _parseBooleanFromInt, _parseBooleanPrimitive, _parseBytePrimitive, _parseDate, _parseDate, _parseDateFromArray, _parseDoublePrimitive, _parseDoublePrimitive, _parseFloatPrimitive, _parseFloatPrimitive, _parseIntPrimitive, _parseIntPrimitive, _parseLongPrimitive, _parseLongPrimitive, _parseShortPrimitive, _parseString, _reportFailedNullCoerce, _shortOverflow, _verifyEndArrayForSingle, _verifyNullForPrimitive, _verifyNullForPrimitiveCoercion, _verifyNullForScalarCoercion, _verifyNumberForScalarCoercion, _verifyStringForScalarCoercion, findContentNullProvider, findContentNullStyle, findConvertingContentDeserializer, findDeserializer, findFormatFeature, findFormatOverrides, findValueNullProvider, getValueClass, getValueType, getValueType, handledType, handleMissingEndArrayForSingle, handleUnknownProperty, isDefaultDeserializer, isDefaultKeyDeserializer, parseDouble
public static final InstantDeserializer<Instant> INSTANT
public static final InstantDeserializer<OffsetDateTime> OFFSET_DATE_TIME
public static final InstantDeserializer<ZonedDateTime> ZONED_DATE_TIME
protected final Function<InstantDeserializer.FromIntegerArguments,T extends Temporal> fromMilliseconds
protected final Function<InstantDeserializer.FromDecimalArguments,T extends Temporal> fromNanoseconds
protected final Function<TemporalAccessor,T extends Temporal> parsedToValue
protected final boolean replaceZeroOffsetAsZ
protected final Boolean _adjustToContextTZOverride
JsonFormat.Feature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE
protected InstantDeserializer(Class<T> supportedType, DateTimeFormatter formatter, Function<TemporalAccessor,T> parsedToValue, Function<InstantDeserializer.FromIntegerArguments,T> fromMilliseconds, Function<InstantDeserializer.FromDecimalArguments,T> fromNanoseconds, BiFunction<T,ZoneId,T> adjust, boolean replaceZeroOffsetAsZ)
protected InstantDeserializer(InstantDeserializer<T> base, DateTimeFormatter f)
protected InstantDeserializer(InstantDeserializer<T> base, Boolean adjustToContextTimezoneOverride)
protected InstantDeserializer<T> withDateFormat(DateTimeFormatter dtf)
withDateFormat
in class JSR310DateTimeDeserializerBase<T extends Temporal>
protected InstantDeserializer<T> withLeniency(Boolean leniency)
withLeniency
in class JSR310DateTimeDeserializerBase<T extends Temporal>
public T deserialize(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context) throws IOException
deserialize
in class com.fasterxml.jackson.databind.JsonDeserializer<T extends Temporal>
IOException
public com.fasterxml.jackson.databind.JsonDeserializer<T> createContextual(com.fasterxml.jackson.databind.DeserializationContext ctxt, com.fasterxml.jackson.databind.BeanProperty property) throws com.fasterxml.jackson.databind.JsonMappingException
createContextual
in interface com.fasterxml.jackson.databind.deser.ContextualDeserializer
createContextual
in class JSR310DateTimeDeserializerBase<T extends Temporal>
com.fasterxml.jackson.databind.JsonMappingException
protected boolean shouldAdjustToContextTimezone(com.fasterxml.jackson.databind.DeserializationContext context)
protected int _countPeriods(String str)
protected T _fromLong(com.fasterxml.jackson.databind.DeserializationContext context, long timestamp)
protected T _fromDecimal(com.fasterxml.jackson.databind.DeserializationContext context, BigDecimal value)
public Object deserializeWithType(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.databind.jsontype.TypeDeserializer typeDeserializer) throws IOException
deserializeWithType
in class com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer<T>
IOException
protected <BOGUS> BOGUS _reportWrongToken(com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.core.JsonToken exp, String unit) throws IOException
IOException
protected <BOGUS> BOGUS _reportWrongToken(com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.core.JsonToken... expTypes) throws IOException
IOException
protected <R> R _handleDateTimeException(com.fasterxml.jackson.databind.DeserializationContext context, DateTimeException e0, String value) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingException
protected <R> R _handleUnexpectedToken(com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.core.JsonParser parser, String message, Object... args) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingException
protected <R> R _handleUnexpectedToken(com.fasterxml.jackson.databind.DeserializationContext context, com.fasterxml.jackson.core.JsonParser parser, com.fasterxml.jackson.core.JsonToken... expTypes) throws com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.databind.JsonMappingException
protected DateTimeException _peelDTE(DateTimeException e)
e
- DateTimeException to peelCopyright © 2019 FasterXML. All rights reserved.