Class FastDateParser.TimeZoneStrategy

Enclosing class:
FastDateParser

static class FastDateParser.TimeZoneStrategy extends FastDateParser.PatternStrategy
A strategy that handles a time zone field in the parsing pattern
  • Field Details

  • Constructor Details

    • TimeZoneStrategy

      TimeZoneStrategy(Locale locale, boolean iso8601Extended)
      Constructs a Strategy that parses a TimeZone.
      Parameters:
      locale - The Locale.
      iso8601Extended - Whether to also accept the ISO 8601 extended offset form "+hh:mm" that FastDatePrinter emits for three or more 'Z' pattern letters.
  • Method Details

    • clearIsoExtendedCache

      static void clearIsoExtendedCache()
    • getIsoExtendedStrategy

      static FastDateParser.Strategy getIsoExtendedStrategy(Locale locale)
      Gets a FastDateParser.TimeZoneStrategy that also parses the ISO 8601 extended offset form "+hh:mm".
      Parameters:
      locale - The Locale.
      Returns:
      A shared strategy instance for the given Locale.
    • skipTimeZone

      static boolean skipTimeZone(String tzId)
      Tests whether to skip the given time zone, true if TimeZone.getTimeZone().

      On Java 25 and up, skips short IDs if ignoreTimeZoneShortIDs is true.

      This method is package private only for testing.

      Parameters:
      tzId - The ID to test.
      Returns:
      Whether to skip the given time zone ID.
    • setCalendar

      void setCalendar(FastDateParser parser, Calendar calendar, String timeZone)
      Specified by:
      setCalendar in class FastDateParser.PatternStrategy
    • toString

      public String toString()
      Converts this instance to a handy debug string.
      Overrides:
      toString in class FastDateParser.PatternStrategy
      Since:
      3.12.0