T - generic type of timepoints on the underlying timelinepublic static class CalendarPeriod.Parser<T> extends Object
Serves for parsing of any calendar intervals on a timeline.
| Modifier and Type | Method and Description |
|---|---|
CalendarPeriod<T> |
parse(CharSequence text,
ChronoParser<T> parser)
Interpretes given text as interval using a localized interval pattern.
|
CalendarPeriod<T> |
parse(CharSequence text,
ChronoParser<T> parser,
String intervalPattern)
Interpretes given text as interval using given interval pattern.
|
public CalendarPeriod<T> parse(CharSequence text, ChronoParser<T> parser) throws ParseException
Interpretes given text as interval using a localized interval pattern.
If given parser does not contain a reference to a locale then the interval pattern "{0}/{1}" will be used.
text - text to be parsedparser - format object for parsing start and end componentsIndexOutOfBoundsException - if given text is emptyParseException - if the text is not parseableparse(CharSequence, ChronoParser, String)public CalendarPeriod<T> parse(CharSequence text, ChronoParser<T> parser, String intervalPattern) throws ParseException
Interpretes given text as interval using given interval pattern.
It is also possible to use an or-pattern logic. Example
see DateInterval.parse(String, ChronoParser, String).
text - text to be parsedparser - format object for parsing start and end componentsintervalPattern - interval pattern containing placeholders {0} and {1} (for start and end)IndexOutOfBoundsException - if given text is emptyParseException - if the text is not parseableCopyright © 2014–2021. All rights reserved.