Class JsonbDateFormatter

java.lang.Object
org.eclipse.yasson.internal.serializer.JsonbDateFormatter

public class JsonbDateFormatter extends Object
Formatter wrapper for different types of dates.
  • Field Details

    • IJSON_DATE_FORMATTER

      public static final DateTimeFormatter IJSON_DATE_FORMATTER
      Default I-JSON date time formatter.
  • Constructor Details

    • JsonbDateFormatter

      public JsonbDateFormatter(DateTimeFormatter dateTimeFormatter, String format, String locale)
      Creates an instance with cached DateTimeFormatter, format and locale.
      Parameters:
      dateTimeFormatter - Reused time formatter.
      format - Format in string.
      locale - Locale in string.
    • JsonbDateFormatter

      public JsonbDateFormatter(String format, 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 Details

    • getDateTimeFormatter

      public DateTimeFormatter getDateTimeFormatter()
      Creates an instance with cached instance of DateTimeFormatter.
      Returns:
      Formatter instance.
    • getFormat

      public String getFormat()
      Format string to be used either by formatter. Needed for formatting Date with SimpleDateFormat, 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()