Class SqlDateSerializer
- java.lang.Object
-
- com.fasterxml.jackson.databind.JsonSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.StdSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.StdScalarSerializer<T>
-
- com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase<Date>
-
- com.fasterxml.jackson.databind.ser.std.SqlDateSerializer
-
- All Implemented Interfaces:
JsonFormatVisitable
,SchemaAware
,ContextualSerializer
,Serializable
public class SqlDateSerializer extends DateTimeSerializerBase<Date>
Compared to regularDate
serialization, we do use String representation here. Why? Basically to truncate of time part, since that should not be used by plain SQL date.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
JsonSerializer.None
-
-
Field Summary
-
Fields inherited from class com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase
_customFormat, _reusedCustomFormat, _useTimestamp
-
Fields inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_handledType
-
-
Constructor Summary
Constructors Modifier Constructor Description SqlDateSerializer()
protected
SqlDateSerializer(Boolean useTimestamp, DateFormat customFormat)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected long
_timestamp(Date value)
void
serialize(Date value, com.fasterxml.jackson.core.JsonGenerator g, SerializerProvider provider)
Method that can be called to ask implementation to serialize values of type this serializer handles.SqlDateSerializer
withFormat(Boolean timestamp, DateFormat customFormat)
-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase
_acceptJsonFormatVisitor, _asTimestamp, _serializeAsString, acceptJsonFormatVisitor, createContextual, getSchema, isEmpty
-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdScalarSerializer
serializeWithType
-
Methods inherited from class com.fasterxml.jackson.databind.ser.std.StdSerializer
_neitherNull, _nonEmpty, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
-
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId
-
-
-
-
Constructor Detail
-
SqlDateSerializer
public SqlDateSerializer()
-
SqlDateSerializer
protected SqlDateSerializer(Boolean useTimestamp, DateFormat customFormat)
-
-
Method Detail
-
withFormat
public SqlDateSerializer withFormat(Boolean timestamp, DateFormat customFormat)
- Specified by:
withFormat
in classDateTimeSerializerBase<Date>
-
_timestamp
protected long _timestamp(Date value)
- Specified by:
_timestamp
in classDateTimeSerializerBase<Date>
-
serialize
public void serialize(Date value, com.fasterxml.jackson.core.JsonGenerator g, SerializerProvider provider) throws IOException
Description copied from class:JsonSerializer
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
- Provider that can be used to get serializers for serializing Objects value contains, if any.- Throws:
IOException
-
-