Class JsonbDateFormatter


  • public class JsonbDateFormatter
    extends Object
    Formatter wrapper for different types of dates.
    • 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 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 Detail

      • 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.
      • isDefault

        public boolean isDefault()