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, _useTimestampFields inherited from class tools.jackson.databind.ser.std.StdSerializer
_handledType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJavaSqlDateSerializer(Boolean useTimestamp, DateFormat customFormat) -
Method Summary
Modifier and TypeMethodDescriptionprotected long_timestamp(Date value) voidserialize(Date value, 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, isEmptyMethods inherited from class tools.jackson.databind.ser.std.StdScalarSerializer
serializeWithTypeMethods 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, wrapAndThrowMethods 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:
withFormatin classDateTimeSerializerBase<Date>
-
_timestamp
- Specified by:
_timestampin classDateTimeSerializerBase<Date>
-
serialize
public void serialize(Date value, JsonGenerator g, SerializationContext provider) throws JacksonException Description copied from class:ValueSerializerMethod that can be called to ask implementation to serialize values of type this serializer handles.- Specified by:
serializein 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:
JacksonException
-