java.lang.Object
tools.jackson.databind.ValueSerializer<T>
tools.jackson.databind.ser.std.StdSerializer<T>
tools.jackson.databind.ser.std.StdScalarSerializer<T>
tools.jackson.databind.ser.jdk.DateTimeSerializerBase<Date>
tools.jackson.databind.ext.sql.JavaSqlDateSerializer
- All Implemented Interfaces:
JsonFormatVisitable
Compared to regular
Date
serialization, we do use String
representation here. Why? Basically to truncate of time part, since
that should not be used by plain SQL date.
NOTE: name was SqlDateSerializer
in Jackson 2.x
-
Nested Class Summary
Nested classes/interfaces inherited from class tools.jackson.databind.ValueSerializer
ValueSerializer.None
-
Field Summary
FieldsFields inherited from class tools.jackson.databind.ser.jdk.DateTimeSerializerBase
_customFormat, _reusedCustomFormat, _useTimestamp
Fields inherited from class tools.jackson.databind.ser.std.StdSerializer
_handledType
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
JavaSqlDateSerializer
(Boolean useTimestamp, DateFormat customFormat) -
Method Summary
Modifier and TypeMethodDescriptionprotected long
_timestamp
(Date value) void
serialize
(Date value, tools.jackson.core.JsonGenerator g, SerializationContext provider) Method that can be called to ask implementation to serialize values of type this serializer handles.withFormat
(Boolean timestamp, DateFormat customFormat) Methods inherited from class tools.jackson.databind.ser.jdk.DateTimeSerializerBase
_acceptJsonFormatVisitor, _asTimestamp, _serializeAsString, acceptJsonFormatVisitor, createContextual, isEmpty
Methods inherited from class tools.jackson.databind.ser.std.StdScalarSerializer
serializeWithType
Methods inherited from class tools.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, _wrapIOFailure, acceptJsonFormatVisitorForBinary, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
Methods inherited from class tools.jackson.databind.ValueSerializer
getDelegatee, isUnwrappingSerializer, properties, replaceDelegatee, resolve, unwrappingSerializer, usesObjectId, withFilterId, withFormatOverrides, withIgnoredProperties
-
Field Details
-
instance
-
-
Constructor Details
-
JavaSqlDateSerializer
public JavaSqlDateSerializer() -
JavaSqlDateSerializer
-
-
Method Details
-
withFormat
- Specified by:
withFormat
in classDateTimeSerializerBase<Date>
-
_timestamp
- Specified by:
_timestamp
in classDateTimeSerializerBase<Date>
-
serialize
public void serialize(Date value, tools.jackson.core.JsonGenerator g, SerializationContext provider) throws tools.jackson.core.JacksonException Description copied from class:ValueSerializer
Method that can be called to ask implementation to serialize values of type this serializer handles.- Specified by:
serialize
in classDateTimeSerializerBase<Date>
- Parameters:
value
- Value to serialize; can not be null.g
- Generator used to output resulting Json contentprovider
- Context that can be used to get serializers for serializing Objects value contains, if any.- Throws:
tools.jackson.core.JacksonException
-