Top Description Fields Constructors Methods
tools.jackson.databind.ext.javatime.ser

public abstract Class InstantSerializerBase<T extends Temporal>

extends JSR310FormattedSerializerBase<T extends Temporal>
Class Inheritance
Known Direct Subclasses
tools.jackson.databind.ext.javatime.ser.OffsetDateTimeSerializer, tools.jackson.databind.ext.javatime.ser.ZonedDateTimeSerializer, tools.jackson.databind.ext.javatime.ser.InstantSerializer
Imports
java.time.format.DateTimeFormatter, java.time.temporal.Temporal, java.util.function.ToIntFunction, .ToLongFunction, com.fasterxml.jackson.annotation.JsonFormat, tools.jackson.core.JacksonException, .JsonGenerator, .JsonToken, .JsonParser.NumberType, tools.jackson.databind.*, tools.jackson.databind.cfg.DateTimeFeature, tools.jackson.databind.ext.javatime.util.DecimalUtils, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, .JsonIntegerFormatVisitor, .JsonNumberFormatVisitor, .JsonValueFormat

Base class for serializers used for java.time.Instant and other Temporal subtypes.

Field Summary

Modifier and TypeField and Description
private final DateTimeFormatter
private final ToLongFunction<T>
private final ToLongFunction<T>
private final ToIntFunction<T>
Inherited from tools.jackson.databind.ext.javatime.ser.JSR310FormattedSerializerBase:
_formatter_integerListType_shape_useNanoseconds_useTimestamp

Constructor Summary

AccessConstructor and Description
protected
InstantSerializerBase(Class<T> supportedType, ToLongFunction<T> getEpochMillis, ToLongFunction<T> getEpochSeconds, ToIntFunction<T> getNanoseconds, DateTimeFormatter defaultFormat)

protected

Method Summary

Modifier and TypeMethod and Description
protected void
protected String
protected JsonToken
serializationShape(SerializationContext ctxt)

Implements abstract tools.jackson.databind.ext.javatime.ser.JSR310SerializerBase.serializationShape.

Overridable helper method used from serializeWithType, to indicate shape of value during serialization; needed to know how type id is to be serialized.

public void
serialize(T value, JsonGenerator generator, SerializationContext ctxt)

Implements abstract tools.jackson.databind.ser.std.StdSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

protected abstract JSR310FormattedSerializerBase<?>
Inherited from tools.jackson.databind.ext.javatime.ser.JSR310FormattedSerializerBase:
_integerListType_useDateTimeFormatter_useTimestampExplicitOnlyacceptJsonFormatVisitorcreateContextualgetTimestampsFeatureuseNanosecondsuseTimestampuseTimestampFromGlobalDefaultswithFeatures

Field Detail

defaultFormatback to summary
private final DateTimeFormatter defaultFormat
getEpochMillisback to summary
private final ToLongFunction<T> getEpochMillis
getEpochSecondsback to summary
private final ToLongFunction<T> getEpochSeconds
getNanosecondsback to summary
private final ToIntFunction<T> getNanoseconds

Constructor Detail

InstantSerializerBaseback to summary
protected InstantSerializerBase(Class<T> supportedType, ToLongFunction<T> getEpochMillis, ToLongFunction<T> getEpochSeconds, ToIntFunction<T> getNanoseconds, DateTimeFormatter defaultFormat)
InstantSerializerBaseback to summary
protected InstantSerializerBase(InstantSerializerBase<T> base, DateTimeFormatter dtf, Boolean useTimestamp, Boolean useNanoseconds, JsonFormat.Shape shape)

Method Detail

_acceptTimestampVisitorback to summary
protected void _acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)

Overrides tools.jackson.databind.ext.javatime.ser.JSR310FormattedSerializerBase._acceptTimestampVisitor.

Annotations
@Override
formatValueback to summary
protected String formatValue(T value, SerializationContext ctxt)
serializationShapeback to summary
protected JsonToken serializationShape(SerializationContext ctxt)

Implements abstract tools.jackson.databind.ext.javatime.ser.JSR310SerializerBase.serializationShape.

Doc from tools.jackson.databind.ext.javatime.ser.JSR310SerializerBase.serializationShape.

Overridable helper method used from serializeWithType, to indicate shape of value during serialization; needed to know how type id is to be serialized.

Annotations
@Override
serializeback to summary
public void serialize(T value, JsonGenerator generator, SerializationContext ctxt) throws JacksonException

Implements abstract tools.jackson.databind.ser.std.StdSerializer.serialize.

Doc from tools.jackson.databind.ValueSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Annotations
@Override
withFormatback to summary
protected abstract JSR310FormattedSerializerBase<?> withFormat(DateTimeFormatter dtf, Boolean useTimestamp, JsonFormat.Shape shape)

Implements abstract tools.jackson.databind.ext.javatime.ser.JSR310FormattedSerializerBase.withFormat.

Annotations
@Override