Class FastDateParser.CopyQuotedStrategy

  • Enclosing class:
    FastDateParser

    private static class FastDateParser.CopyQuotedStrategy
    extends FastDateParser.Strategy
    A strategy that copies the static or quoted field in the parsing pattern
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String formatField  
    • Constructor Summary

      Constructors 
      Constructor Description
      CopyQuotedStrategy​(java.lang.String formatField)
      Construct a Strategy that ensures the formatField has literal text
    • 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) boolean isNumber()
      Is this field a number? The default implementation returns false.
      • Methods inherited from class java.lang.Object

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

      • formatField

        private final java.lang.String formatField
    • Constructor Detail

      • CopyQuotedStrategy

        CopyQuotedStrategy​(java.lang.String formatField)
        Construct a Strategy that ensures the formatField has literal text
        Parameters:
        formatField - The literal text to match
    • Method Detail

      • isNumber

        boolean isNumber()
        Is this field a number? The default implementation returns false.
        Overrides:
        isNumber in class FastDateParser.Strategy
        Returns:
        true, if field is a number
      • 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