Module org.eclipse.yasson
Class SqlDateSerializer
java.lang.Object
org.eclipse.yasson.internal.serializer.types.TypeSerializer<Date>
org.eclipse.yasson.internal.serializer.types.AbstractDateSerializer<Date>
org.eclipse.yasson.internal.serializer.types.DateSerializer<Date>
org.eclipse.yasson.internal.serializer.types.SqlDateSerializer
- All Implemented Interfaces:
ModelSerializer
-
Field Summary
Fields inherited from class org.eclipse.yasson.internal.serializer.types.AbstractDateSerializer
UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringformatDefault(Date value, Locale locale) Format with default formatter for a given java.time date object.protected StringformatWithFormatter(Date value, DateTimeFormatter formatter) Format date object with given formatter.protected InstantConvert java.time object to epoch milliseconds instant.Methods inherited from class org.eclipse.yasson.internal.serializer.types.DateSerializer
formatStrictIJson, toTemporalAccessorMethods inherited from class org.eclipse.yasson.internal.serializer.types.AbstractDateSerializer
getZonedFormatter, serializeKey, serializeValueMethods inherited from class org.eclipse.yasson.internal.serializer.types.TypeSerializer
serialize
-
Constructor Details
-
SqlDateSerializer
SqlDateSerializer(TypeSerializerBuilder serializerBuilder)
-
-
Method Details
-
toInstant
Description copied from class:AbstractDateSerializerConvert java.time object to epoch milliseconds instant. Discards zone offset and zone id information.- Overrides:
toInstantin classDateSerializer<Date>- Parameters:
value- date object to convert- Returns:
- instant
-
formatDefault
Description copied from class:AbstractDateSerializerFormat with default formatter for a given java.time date object. Different default formatter for each date object type is used.- Overrides:
formatDefaultin classDateSerializer<Date>- Parameters:
value- date objectlocale- locale from annotation / default not null- Returns:
- formatted date obj as string
-
formatWithFormatter
Description copied from class:AbstractDateSerializerFormat date object with given formatter.- Overrides:
formatWithFormatterin classDateSerializer<Date>- Parameters:
value- date object to formatformatter- formatter to format with- Returns:
- formatted result
-