Class DateSerializer
java.lang.Object
com.fasterxml.jackson.databind.JsonSerializer<Date>
com.fasterxml.jackson.databind.ser.std.StdSerializer<Date>
com.fasterxml.jackson.databind.ser.std.StdScalarSerializer<Date>
com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase<Date>
com.fasterxml.jackson.databind.ser.std.DateSerializer
- All Implemented Interfaces:
JsonFormatVisitable
,SchemaAware
,ContextualSerializer
,Serializable
For efficiency, we will serialize Dates as longs, instead of
potentially more readable Strings.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonSerializer
JsonSerializer.None
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DateSerializer
Default instance that is used when no contextual configuration is needed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
serialize
(Date value, JsonGenerator g, SerializerProvider 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 com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase
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
getSchema, handledType, wrapAndThrow, wrapAndThrow
Methods inherited from class com.fasterxml.jackson.databind.JsonSerializer
getDelegatee, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, unwrappingSerializer, usesObjectId, withFilterId, withIgnoredProperties
-
Field Details
-
instance
Default instance that is used when no contextual configuration is needed.
-
-
Constructor Details
-
DateSerializer
public DateSerializer() -
DateSerializer
-
-
Method Details
-
withFormat
- Specified by:
withFormat
in classDateTimeSerializerBase<Date>
-
serialize
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
-