Top Description Fields Constructors Methods
com.fasterxml.jackson.databind.ser.std

public Class DateSerializer

extends DateTimeSerializerBase<Date>
Class Inheritance
Annotations
@JacksonStdImpl
@SuppressWarnings:serial
Imports
java.io.IOException, java.text.DateFormat, java.util.*, com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.annotation.JacksonStdImpl

References Deprecated

DateTimeSerializerBase is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

For efficiency, we will serialize Dates as longs, instead of potentially more readable Strings.

Field Summary

Modifier and TypeField and Description
public static final DateSerializer
instance

References Deprecated DateSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
Default instance that is used when no contextual configuration is needed.
Inherited from com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase:
_customFormat_reusedCustomFormat_useTimestamp

Constructor Summary

AccessConstructor and Description
public
public
DateSerializer(Boolean useTimestamp, DateFormat customFormat)

Method Summary

Modifier and TypeMethod and Description
protected long
public void
serialize(Date
Value to serialize; can not be null.
value
,
JsonGenerator
Generator used to output resulting Json content
g
,
SerializerProvider
Provider that can be used to get serializers for serializing Objects value contains, if any.
provider
)

Implements abstract com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

public DateSerializer
withFormat(Boolean timestamp, DateFormat customFormat)

Implements abstract com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase.withFormat.

References Deprecated DateSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

Inherited from com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase:
_acceptJsonFormatVisitor_asTimestamp_serializeAsStringacceptJsonFormatVisitorcreateContextualgetSchemaisEmpty

Field Detail

instanceback to summary
public static final DateSerializer instance

References Deprecated

DateSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Default instance that is used when no contextual configuration is needed.

Constructor Detail

DateSerializerback to summary
public DateSerializer()
DateSerializerback to summary
public DateSerializer(Boolean useTimestamp, DateFormat customFormat)

Method Detail

_timestampback to summary
protected long _timestamp(Date value)

Implements abstract com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase._timestamp.

Annotations
@Override
serializeback to summary
public void serialize(Date value, JsonGenerator g, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Parameters
value:Date

Value to serialize; can not be null.

g:JsonGenerator

Generator used to output resulting Json content

provider:SerializerProvider

Provider that can be used to get serializers for serializing Objects value contains, if any.

Annotations
@Override
withFormatback to summary
public DateSerializer withFormat(Boolean timestamp, DateFormat customFormat)

Implements abstract com.fasterxml.jackson.databind.ser.std.DateTimeSerializerBase.withFormat.

References Deprecated

DateSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@Override