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