Class ConfigurableDateTimeParser
java.lang.Object
com.ethlo.time.token.ConfigurableDateTimeParser
- All Implemented Interfaces:
DateTimeParser
A configurable format `DateTimeParser`.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate DateTimedoParse(String text, ParsePosition parsePosition) static DateTimeParserof(DateTimeToken... tokens) Create a new parser with the specified tokensparse(String text, ParsePosition parsePosition) Parse the text from the given position of the parsePositionprivate intscale(int value, int length) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DateTimeParser
parse
-
Field Details
-
tokens
-
-
Constructor Details
-
ConfigurableDateTimeParser
-
-
Method Details
-
of
Create a new parser with the specified tokens- Parameters:
tokens- The tokens expected in the format- Returns:
- A new parser instance
-
parse
Description copied from interface:DateTimeParserParse the text from the given position of the parsePosition- Specified by:
parsein interfaceDateTimeParser- Parameters:
text- The text to parseparsePosition- The position in which to start- Returns:
- A DateTime holding the parsed data
-
doParse
-
scale
private int scale(int value, int length)
-