Class ConfigurableDateTimeParser

java.lang.Object
com.ethlo.time.token.ConfigurableDateTimeParser
All Implemented Interfaces:
DateTimeParser

public class ConfigurableDateTimeParser extends Object implements DateTimeParser
A configurable format `DateTimeParser`.
  • Method Details

    • of

      public static DateTimeParser of(DateTimeToken... tokens)
      Create a new parser with the specified tokens
      Parameters:
      tokens - The tokens expected in the format
      Returns:
      A new parser instance
    • parse

      public DateTime parse(String text, ParsePosition parsePosition)
      Description copied from interface: DateTimeParser
      Parse the text from the given position of the parsePosition
      Specified by:
      parse in interface DateTimeParser
      Parameters:
      text - The text to parse
      parsePosition - The position in which to start
      Returns:
      A DateTime holding the parsed data