org.openstreetmap.josm.tools
Class FallbackDateParser
java.lang.Object
org.openstreetmap.josm.tools.FallbackDateParser
public class FallbackDateParser
- extends java.lang.Object
Handles a number of different date formats encountered in OSM. This is built
based on similar code in JOSM. This class is not threadsafe, a separate
instance must be created per thread.
Method Summary |
java.util.Date |
parse(java.lang.String date)
Attempts to parse the specified date. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
formats
private static final java.lang.String[] formats
dateParsers
private java.util.List<java.text.DateFormat> dateParsers
activeDateParser
private int activeDateParser
FallbackDateParser
public FallbackDateParser()
- Creates a new instance.
parse
public java.util.Date parse(java.lang.String date)
throws java.text.ParseException
- Attempts to parse the specified date.
- Parameters:
date
- The date to parse.
- Returns:
- The date.
- Throws:
java.text.ParseException
- Occurs if the date does not match any of the supported date
formats.
JOSM