public class ZonedDateTimeSerializer extends InstantSerializerBase<ZonedDateTime>
| Modifier and Type | Field and Description |
|---|---|
protected DateTimeFormatter |
_formatter
Specific format to use, if not default format: non null value
also indicates that serialization is to be done as JSON String,
not numeric timestamp, unless
#_useTimestamp is true. |
protected com.fasterxml.jackson.databind.JavaType |
_integerListType
Lazily constructed
JavaType representing type
List<Integer>. |
protected com.fasterxml.jackson.annotation.JsonFormat.Shape |
_shape |
protected Boolean |
_useNanoseconds
Flag that indicates that numeric timestamp values must be written using
nanosecond timestamps if the datatype supports such resolution,
regardless of other settings.
|
protected Boolean |
_useTimestamp
Flag that indicates that serialization must be done as the
Java timestamp, regardless of other settings.
|
protected Boolean |
_writeZoneId
Flag for
JsonFormat.Feature.WRITE_DATES_WITH_ZONE_ID |
static ZonedDateTimeSerializer |
INSTANCE |
| Modifier | Constructor and Description |
|---|---|
protected |
ZonedDateTimeSerializer() |
|
ZonedDateTimeSerializer(DateTimeFormatter formatter) |
protected |
ZonedDateTimeSerializer(ZonedDateTimeSerializer base,
Boolean useTimestamp,
Boolean useNanoseconds,
DateTimeFormatter formatter,
Boolean writeZoneId) |
protected |
ZonedDateTimeSerializer(ZonedDateTimeSerializer base,
Boolean useTimestamp,
DateTimeFormatter formatter,
Boolean writeZoneId) |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.databind.JavaType |
_integerListType(com.fasterxml.jackson.databind.SerializerProvider prov) |
protected DateTimeFormatter |
_useDateTimeFormatter(com.fasterxml.jackson.databind.SerializerProvider prov,
com.fasterxml.jackson.annotation.JsonFormat.Value format) |
protected boolean |
_useTimestampExplicitOnly(com.fasterxml.jackson.databind.SerializerProvider provider) |
void |
acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor,
com.fasterxml.jackson.databind.JavaType typeHint) |
com.fasterxml.jackson.databind.JsonSerializer<?> |
createContextual(com.fasterxml.jackson.databind.SerializerProvider prov,
com.fasterxml.jackson.databind.BeanProperty property) |
com.fasterxml.jackson.databind.JsonNode |
getSchema(com.fasterxml.jackson.databind.SerializerProvider provider,
Type typeHint) |
protected com.fasterxml.jackson.databind.SerializationFeature |
getTimestampsFeature()
Overridable method that determines
SerializationFeature that is used as
the global default in determining if date/time value serialized should use numeric
format ("timestamp") or not. |
protected com.fasterxml.jackson.core.JsonToken |
serializationShape(com.fasterxml.jackson.databind.SerializerProvider provider)
Overridable helper method used from
serializeWithType(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer), to indicate
shape of value during serialization; needed to know how type id is to be
serialized. |
void |
serialize(ZonedDateTime value,
com.fasterxml.jackson.core.JsonGenerator g,
com.fasterxml.jackson.databind.SerializerProvider provider) |
void |
serializeWithType(T value,
com.fasterxml.jackson.core.JsonGenerator g,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer) |
boolean |
shouldWriteWithZoneId(com.fasterxml.jackson.databind.SerializerProvider ctxt) |
protected boolean |
useNanoseconds(com.fasterxml.jackson.databind.SerializerProvider provider) |
protected boolean |
useTimestamp(com.fasterxml.jackson.databind.SerializerProvider provider) |
protected com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<?> |
withFeatures(Boolean writeZoneId)
Deprecated.
|
protected com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<?> |
withFeatures(Boolean writeZoneId,
Boolean writeNanoseconds) |
protected com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<?> |
withFormat(Boolean useTimestamp,
DateTimeFormatter formatter,
com.fasterxml.jackson.annotation.JsonFormat.Shape shape) |
_acceptTimestampVisitor, formatValue_neitherNull, _nonEmpty, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrowpublic static final ZonedDateTimeSerializer INSTANCE
protected final Boolean _writeZoneId
JsonFormat.Feature.WRITE_DATES_WITH_ZONE_IDprotected final Boolean _useTimestamp
protected final Boolean _useNanoseconds
protected final DateTimeFormatter _formatter
#_useTimestamp is true.protected final com.fasterxml.jackson.annotation.JsonFormat.Shape _shape
protected transient volatile com.fasterxml.jackson.databind.JavaType _integerListType
JavaType representing type
List<Integer>.protected ZonedDateTimeSerializer()
public ZonedDateTimeSerializer(DateTimeFormatter formatter)
protected ZonedDateTimeSerializer(ZonedDateTimeSerializer base, Boolean useTimestamp, DateTimeFormatter formatter, Boolean writeZoneId)
protected ZonedDateTimeSerializer(ZonedDateTimeSerializer base, Boolean useTimestamp, Boolean useNanoseconds, DateTimeFormatter formatter, Boolean writeZoneId)
protected com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<?> withFormat(Boolean useTimestamp, DateTimeFormatter formatter, com.fasterxml.jackson.annotation.JsonFormat.Shape shape)
withFormat in class InstantSerializerBase<ZonedDateTime>@Deprecated protected com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<?> withFeatures(Boolean writeZoneId)
protected com.fasterxml.jackson.datatype.jsr310.ser.JSR310FormattedSerializerBase<?> withFeatures(Boolean writeZoneId, Boolean writeNanoseconds)
public void serialize(ZonedDateTime value, com.fasterxml.jackson.core.JsonGenerator g, com.fasterxml.jackson.databind.SerializerProvider provider) throws IOException
serialize in class InstantSerializerBase<ZonedDateTime>IOExceptionpublic boolean shouldWriteWithZoneId(com.fasterxml.jackson.databind.SerializerProvider ctxt)
protected com.fasterxml.jackson.core.JsonToken serializationShape(com.fasterxml.jackson.databind.SerializerProvider provider)
serializeWithType(T, com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.databind.SerializerProvider, com.fasterxml.jackson.databind.jsontype.TypeSerializer), to indicate
shape of value during serialization; needed to know how type id is to be
serialized.serializationShape in class InstantSerializerBase<ZonedDateTime>public com.fasterxml.jackson.databind.JsonSerializer<?> createContextual(com.fasterxml.jackson.databind.SerializerProvider prov,
com.fasterxml.jackson.databind.BeanProperty property)
throws com.fasterxml.jackson.databind.JsonMappingException
createContextual in interface com.fasterxml.jackson.databind.ser.ContextualSerializercom.fasterxml.jackson.databind.JsonMappingExceptionpublic com.fasterxml.jackson.databind.JsonNode getSchema(com.fasterxml.jackson.databind.SerializerProvider provider,
Type typeHint)
getSchema in interface com.fasterxml.jackson.databind.jsonschema.SchemaAwaregetSchema in class com.fasterxml.jackson.databind.ser.std.StdSerializer<T>public void acceptJsonFormatVisitor(com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper visitor,
com.fasterxml.jackson.databind.JavaType typeHint)
throws com.fasterxml.jackson.databind.JsonMappingException
acceptJsonFormatVisitor in interface com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitableacceptJsonFormatVisitor in class com.fasterxml.jackson.databind.ser.std.StdSerializer<T>com.fasterxml.jackson.databind.JsonMappingExceptionprotected com.fasterxml.jackson.databind.JavaType _integerListType(com.fasterxml.jackson.databind.SerializerProvider prov)
protected com.fasterxml.jackson.databind.SerializationFeature getTimestampsFeature()
SerializationFeature that is used as
the global default in determining if date/time value serialized should use numeric
format ("timestamp") or not.
Note that this feature is just the baseline setting and may be overridden on per-type or per-property basis.
protected boolean useTimestamp(com.fasterxml.jackson.databind.SerializerProvider provider)
protected boolean _useTimestampExplicitOnly(com.fasterxml.jackson.databind.SerializerProvider provider)
protected boolean useNanoseconds(com.fasterxml.jackson.databind.SerializerProvider provider)
protected DateTimeFormatter _useDateTimeFormatter(com.fasterxml.jackson.databind.SerializerProvider prov, com.fasterxml.jackson.annotation.JsonFormat.Value format)
public void serializeWithType(T value,
com.fasterxml.jackson.core.JsonGenerator g,
com.fasterxml.jackson.databind.SerializerProvider provider,
com.fasterxml.jackson.databind.jsontype.TypeSerializer typeSer)
throws IOException
serializeWithType in class com.fasterxml.jackson.databind.JsonSerializer<T>IOExceptionCopyright © 2021 FasterXML. All rights reserved.