Package com.ethlo.time.token
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 DateTime
doParse
(String text, ParsePosition parsePosition) static DateTimeParser
of
(DateTimeToken... tokens) Create a new parser with the specified tokensparse
(String text, ParsePosition parsePosition) Parse the text from the given position of the parsePositionprivate int
scale
(int value, int length) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.ethlo.time.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:DateTimeParser
Parse the text from the given position of the parsePosition- Specified by:
parse
in 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)
-