- java.lang.Object
-
- org.eclipse.yasson.internal.serializer.JsonbDateFormatter
-
public class JsonbDateFormatter extends Object
Formatter wrapper for different types of dates.
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatterIJSON_DATE_FORMATTERDefault I-JSON date time formatter.
-
Constructor Summary
Constructors Constructor Description JsonbDateFormatter(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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeFormattergetDateTimeFormatter()Creates an instance with cached instance ofDateTimeFormatter.static JsonbDateFormattergetDefault()StringgetFormat()Format string to be used either by formatter.StringgetLocale()Locale to use with formatter.booleanisDefault()
-
-
-
Field Detail
-
IJSON_DATE_FORMATTER
public static final DateTimeFormatter IJSON_DATE_FORMATTER
Default I-JSON date time formatter.
-
-
Constructor Detail
-
JsonbDateFormatter
public JsonbDateFormatter(DateTimeFormatter dateTimeFormatter, String format, String locale)
Creates an instance with cachedDateTimeFormatter, format and locale.- Parameters:
dateTimeFormatter- Reused time formatter.format- Format in string.locale- Locale in string.
-
-
Method Detail
-
getDateTimeFormatter
public DateTimeFormatter getDateTimeFormatter()
Creates an instance with cached instance ofDateTimeFormatter.- Returns:
- Formatter instance.
-
getFormat
public String getFormat()
Format string to be used either by formatter. Needed for formattingDatewithSimpleDateFormat, which is not threadsafe.- Returns:
- Format.
-
getLocale
public String getLocale()
Locale to use with formatter.- Returns:
- Locale.
-
getDefault
public static JsonbDateFormatter getDefault()
-
isDefault
public boolean isDefault()
-
-