Class LocalDateTimeSerializer
java.lang.Object
org.eclipse.yasson.internal.serializer.types.TypeSerializer<LocalDateTime>
org.eclipse.yasson.internal.serializer.types.AbstractDateSerializer<LocalDateTime>
org.eclipse.yasson.internal.serializer.types.LocalDateTimeSerializer
- All Implemented Interfaces:
ModelSerializer
Serializer of the
LocalDateTime type.-
Field Summary
Fields inherited from class AbstractDateSerializer
UTC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringformatDefault(LocalDateTime value, Locale locale) Format with default formatter for a given java.time date object.protected StringformatStrictIJson(LocalDateTime value) Format date object as strict IJson date format.protected StringformatWithFormatter(LocalDateTime value, DateTimeFormatter formatter) Format date object with given formatter.protected InstanttoInstant(LocalDateTime value) Convert java.time object to epoch milliseconds instant.Methods inherited from class AbstractDateSerializer
getZonedFormatter, serializeKey, serializeValue, toTemporalAccessorMethods inherited from class TypeSerializer
serialize
-
Constructor Details
-
LocalDateTimeSerializer
LocalDateTimeSerializer(TypeSerializerBuilder builder)
-
-
Method Details
-
toInstant
Description copied from class:AbstractDateSerializerConvert java.time object to epoch milliseconds instant. Discards zone offset and zone id information.- Specified by:
toInstantin classAbstractDateSerializer<LocalDateTime>- 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.- Specified by:
formatDefaultin classAbstractDateSerializer<LocalDateTime>- 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 classAbstractDateSerializer<LocalDateTime>- Parameters:
value- date object to formatformatter- formatter to format with- Returns:
- formatted result
-
formatStrictIJson
Description copied from class:AbstractDateSerializerFormat date object as strict IJson date format.- Overrides:
formatStrictIJsonin classAbstractDateSerializer<LocalDateTime>- Parameters:
value- value to format- Returns:
- formatted result
-