Class JsonbDateFormatter
java.lang.Object
org.eclipse.yasson.internal.serializer.JsonbDateFormatter
Formatter wrapper for different types of dates.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionJsonbDateFormatter(String format, String locale)
Creates an instance with format string and locale.JsonbDateFormatter(DateTimeFormatter dateTimeFormatter, String format, String locale)
Creates an instance with cachedDateTimeFormatter
, format and locale. -
Method Summary
Modifier and TypeMethodDescriptionCreates an instance with cached instance ofDateTimeFormatter
.static JsonbDateFormatter
Format string to be used either by formatter.Locale to use with formatter.boolean
-
Field Details
-
IJSON_DATE_FORMATTER
Default I-JSON date time formatter.
-
-
Constructor Details
-
JsonbDateFormatter
Creates an instance with cachedDateTimeFormatter
, format and locale.- Parameters:
dateTimeFormatter
- Reused time formatter.format
- Format in string.locale
- Locale in string.
-
JsonbDateFormatter
Creates an instance with format string and locale. Formatter will be created on every formatting / parsing operation.- Parameters:
format
- Formatter format.locale
- Locale in string.
-
-
Method Details
-
getDateTimeFormatter
Creates an instance with cached instance ofDateTimeFormatter
.- Returns:
- Formatter instance.
-
getFormat
Format string to be used either by formatter. Needed for formattingDate
withSimpleDateFormat
, which is not threadsafe.- Returns:
- Format.
-
getLocale
Locale to use with formatter.- Returns:
- Locale.
-
getDefault
-
isDefault
public boolean isDefault()
-