Class FastDateParser.CaseInsensitiveTextStrategy

  • Enclosing class:
    FastDateParser

    private static class FastDateParser.CaseInsensitiveTextStrategy
    extends FastDateParser.Strategy
    A strategy that handles a text field in the parsing pattern
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int field  
      private java.util.Map<java.lang.String,​java.lang.Integer> lKeyValues  
      private java.util.Locale locale  
    • Constructor Summary

      Constructors 
      Constructor Description
      CaseInsensitiveTextStrategy​(int field, java.util.Calendar definingCalendar, java.util.Locale locale)
      Construct a Strategy that parses a Text field
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) boolean addRegex​(FastDateParser parser, java.lang.StringBuilder regex)
      Generate a Pattern regular expression to the StringBuilder which will accept this field
      (package private) void setCalendar​(FastDateParser parser, java.util.Calendar cal, java.lang.String value)
      Set the Calendar with the parsed field.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • field

        private final int field
      • locale

        private final java.util.Locale locale
      • lKeyValues

        private final java.util.Map<java.lang.String,​java.lang.Integer> lKeyValues
    • Constructor Detail

      • CaseInsensitiveTextStrategy

        CaseInsensitiveTextStrategy​(int field,
                                    java.util.Calendar definingCalendar,
                                    java.util.Locale locale)
        Construct a Strategy that parses a Text field
        Parameters:
        field - The Calendar field
        definingCalendar - The Calendar to use
        locale - The Locale to use
    • 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