Class FastDateParser.ISO8601TimeZoneStrategy

    • Constructor Detail

      • ISO8601TimeZoneStrategy

        ISO8601TimeZoneStrategy​(java.lang.String pattern)
        Construct a Strategy that parses a TimeZone
        Parameters:
        pattern - The Pattern
    • Method Detail

      • addRegex

        boolean addRegex​(FastDateParser parser,
                         java.lang.StringBuilder regex)
        Generate a Pattern regular expression to the StringBuilder which will accept this field
        Specified by:
        addRegex in class FastDateParser.Strategy
        Parameters:
        parser - The parser calling this strategy
        regex - The StringBuilder to append to
        Returns:
        true, if this field will set the calendar; false, if this field is a constant value
      • setCalendar

        void setCalendar​(FastDateParser parser,
                         java.util.Calendar cal,
                         java.lang.String value)
        Set the Calendar with the parsed field.

        The default implementation does nothing.

        Overrides:
        setCalendar in class FastDateParser.Strategy
        Parameters:
        parser - The parser calling this strategy
        cal - The Calendar to set
        value - The parsed field to translate and set in cal
      • getStrategy

        static FastDateParser.Strategy getStrategy​(int tokenLen)
        Factory method for ISO8601TimeZoneStrategies.
        Parameters:
        tokenLen - a token indicating the length of the TimeZone String to be formatted.
        Returns:
        a ISO8601TimeZoneStrategy that can format TimeZone String of length tokenLen. If no such strategy exists, an IllegalArgumentException will be thrown.