Class DateTimeParserResult


  • public class DateTimeParserResult
    extends java.lang.Object
    DateTimeParserResult is the result of a DateTimeParser analysis.
    • Field Detail

      • timeElements

        public int timeElements
      • dateElements

        public int dateElements
      • timeFirst

        public java.lang.Boolean timeFirst
      • dateTimeSeparator

        public java.lang.Character dateTimeSeparator
      • yearOffset

        public int yearOffset
      • monthOffset

        public int monthOffset
      • dayOffset

        public int dayOffset
      • dateFieldLengths

        public int[] dateFieldLengths
      • dateFieldOffsets

        public int[] dateFieldOffsets
      • dateFieldPad

        public int[] dateFieldPad
      • timeFieldLengths

        public MinMax[] timeFieldLengths
      • timeFieldOffsets

        public int[] timeFieldOffsets
      • timeFieldPad

        public int[] timeFieldPad
      • timeZone

        public java.lang.String timeZone
      • dateSeparator

        public java.lang.Character dateSeparator
      • amPmIndicator

        public java.lang.Boolean amPmIndicator
      • tokenized

        public java.util.List<com.cobber.fta.dates.FormatterToken> tokenized
    • Method Detail

      • isDateUnbound

        protected boolean isDateUnbound()
      • updateFormatString

        public void updateFormatString​(java.lang.String formatString)
      • isValid8

        public boolean isValid8​(java.lang.String input)
        Determine whether a string input matches this DateTimeParserResult.
        Parameters:
        input - The string to validate (stripped of whitespace.
        Returns:
        A boolean indicating if the input is valid.
      • isValid

        public boolean isValid​(java.lang.String input)
        Determine whether a string input matches this DateTimeParserResult.
        Parameters:
        input - The string to validate (stripped of whitespace.
        Returns:
        A boolean indicating if the input is valid.
      • asResult

        public static DateTimeParserResult asResult​(java.lang.String formatString,
                                                    DateTimeParser.DateResolutionMode resolutionMode,
                                                    java.util.Locale locale)
        Given an input string with a DateTimeFormatter pattern convert to a DateTimeParserResult
        Parameters:
        formatString - A DateTimeString using DateTimeFormatter patterns
        resolutionMode - When we have ambiguity - should we prefer to conclude day first, month first or unspecified
        locale - Locale the input string is in
        Returns:
        The corresponding DateTimeParserResult
      • parse

        public void parse​(java.lang.String input)
        Determine whether a string input matches this DateTimeParserResult.
        Parameters:
        input - The string to validate (stripped of whitespace).
        Throws:
        java.time.format.DateTimeParseException - If the input does not match the DateTimeParserResult Note: This routine is akin to the parse() methods on LocalDateTime/ZonedDateTime etc. but runs faster and does not return an instance of the LocalDateTime/ZonedDateTime etc.
      • getType

        public FTAType getType()
        Return the detected type of this input.
        Returns:
        The detected type of this input, will be either "Date", "Time", "DateTime", "ZonedDateTime" or "OffsetDateTime".
      • getRegExp

        public java.lang.String getRegExp()
        Return the Regular Expression that matches this Date/Time object. All valid inputs should match this Regular Expression, however, not all inputs that match this RE are necessarily valid. For example, 28/13/2017 will match the RE (\d{2}/\d{2}/\d{4}) however this is not a valid date with pattern dd/MM/yyyy.
        Returns:
        The Regular Expression that mirrors this Date/Time object.
      • getFormatString

        public java.lang.String getFormatString()
        Return a DateTimeFormatter representation of the DateTimeParserResult.
        Returns:
        A String representation using DateTimeFormatter semantics.