public class DateTimeMultiParser extends Object
DateTimeParser
that are considered ambiguous. Two DateTimeParser
are considered
ambiguous when they can potentially produce 2 different TemporalAccessor
.
e.g. "dd/MM/yyyy" and "MM/dd/yyyy"
This class will try all the parsers and keep the all the successful results.
This class is thread-safe once an instance is created.
Modifier and Type | Class and Description |
---|---|
static class |
DateTimeMultiParser.MultipleParseResult
Nested class representing the result of a multi-parse.
|
Modifier and Type | Method and Description |
---|---|
List<DateTimeParser> |
getAllParsers()
Get the list of all parsers: the preferred (if specified in the constructor) + otherParsers.
|
DateTimeMultiParser.MultipleParseResult |
parse(String input)
Try to parse the input using all the parsers specified in the constructor.
|
public List<DateTimeParser> getAllParsers()
public DateTimeMultiParser.MultipleParseResult parse(String input)
input
- DateTimeMultiParser.MultipleParseResult
instance, never null.Copyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.