Class InstantSerializerBase<T extends Temporal>
java.lang.Object
tools.jackson.databind.ValueSerializer<T>
tools.jackson.databind.ser.std.StdSerializer<T>
tools.jackson.databind.ext.javatime.ser.JSR310SerializerBase<T>
tools.jackson.databind.ext.javatime.ser.JSR310FormattedSerializerBase<T>
tools.jackson.databind.ext.javatime.ser.InstantSerializerBase<T>
- All Implemented Interfaces:
JsonFormatVisitable
- Direct Known Subclasses:
InstantSerializer, OffsetDateTimeSerializer, ZonedDateTimeSerializer
public abstract class InstantSerializerBase<T extends Temporal>
extends JSR310FormattedSerializerBase<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class ValueSerializer
ValueSerializer.None -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DateTimeFormatterprivate final ToLongFunction<T> private final ToLongFunction<T> private final ToIntFunction<T> Fields inherited from class JSR310FormattedSerializerBase
_formatter, _integerListType, _shape, _useNanoseconds, _useTimestampFields inherited from class StdSerializer
_handledType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantSerializerBase(Class<T> supportedType, ToLongFunction<T> getEpochMillis, ToLongFunction<T> getEpochSeconds, ToIntFunction<T> getNanoseconds, DateTimeFormatter defaultFormat) protectedInstantSerializerBase(InstantSerializerBase<T> base, DateTimeFormatter dtf, Boolean useTimestamp, Boolean useNanoseconds, com.fasterxml.jackson.annotation.JsonFormat.Shape shape) -
Method Summary
Modifier and TypeMethodDescriptionprotected void_acceptTimestampVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) protected T_truncateToMillis(T value) protected StringformatValue(T value, SerializationContext ctxt) protected tools.jackson.core.JsonTokenOverridable helper method used fromJSR310SerializerBase.serializeWithType(T, JsonGenerator, SerializationContext, TypeSerializer), to indicate shape of value during serialization; needed to know how type id is to be serialized.voidserialize(T value, tools.jackson.core.JsonGenerator generator, SerializationContext ctxt) Method that can be called to ask implementation to serialize values of type this serializer handles.protected abstract JSR310FormattedSerializerBase<?> withFormat(DateTimeFormatter dtf, Boolean useTimestamp, com.fasterxml.jackson.annotation.JsonFormat.Shape shape) Methods inherited from class JSR310FormattedSerializerBase
_integerListType, _useDateTimeFormatter, _useTimestampExplicitOnly, acceptJsonFormatVisitor, createContextual, getTimestampsFeature, useNanoseconds, useTimestamp, useTimestampFromGlobalDefaults, withFeaturesMethods inherited from class JSR310SerializerBase
serializeWithTypeMethods inherited from class StdSerializer
_neitherNull, _nonEmpty, _wrapIOFailure, acceptJsonFormatVisitorForBinary, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrowMethods inherited from class ValueSerializer
getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, resolve, unwrappingSerializer, usesObjectId, withFilterId, withFormatOverrides, withIgnoredProperties
-
Field Details
-
defaultFormat
-
getEpochMillis
-
getEpochSeconds
-
getNanoseconds
-
-
Constructor Details
-
InstantSerializerBase
protected InstantSerializerBase(Class<T> supportedType, ToLongFunction<T> getEpochMillis, ToLongFunction<T> getEpochSeconds, ToIntFunction<T> getNanoseconds, DateTimeFormatter defaultFormat) -
InstantSerializerBase
protected InstantSerializerBase(InstantSerializerBase<T> base, DateTimeFormatter dtf, Boolean useTimestamp, Boolean useNanoseconds, com.fasterxml.jackson.annotation.JsonFormat.Shape shape)
-
-
Method Details
-
withFormat
protected abstract JSR310FormattedSerializerBase<?> withFormat(DateTimeFormatter dtf, Boolean useTimestamp, com.fasterxml.jackson.annotation.JsonFormat.Shape shape) - Specified by:
withFormatin classJSR310FormattedSerializerBase<T extends Temporal>
-
serialize
public void serialize(T value, tools.jackson.core.JsonGenerator generator, SerializationContext ctxt) throws tools.jackson.core.JacksonException Description copied from class:ValueSerializerMethod that can be called to ask implementation to serialize values of type this serializer handles.- Specified by:
serializein classStdSerializer<T extends Temporal>- Parameters:
value- Value to serialize; can not be null.generator- Generator used to output resulting Json contentctxt- Context that can be used to get serializers for serializing Objects value contains, if any.- Throws:
tools.jackson.core.JacksonException
-
_acceptTimestampVisitor
- Overrides:
_acceptTimestampVisitorin classJSR310FormattedSerializerBase<T extends Temporal>
-
serializationShape
Description copied from class:JSR310SerializerBaseOverridable helper method used fromJSR310SerializerBase.serializeWithType(T, JsonGenerator, SerializationContext, TypeSerializer), to indicate shape of value during serialization; needed to know how type id is to be serialized.- Specified by:
serializationShapein classJSR310SerializerBase<T extends Temporal>
-
formatValue
-
_truncateToMillis
-