org.openstreetmap.josm.tools
Class FallbackDateParser

java.lang.Object
  extended by 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.


Field Summary
private  int activeDateParser
           
private  java.util.List<java.text.DateFormat> dateParsers
           
private static java.lang.String[] formats
           
 
Constructor Summary
FallbackDateParser()
          Creates a new instance.
 
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
 

Field Detail

formats

private static final java.lang.String[] formats

dateParsers

private java.util.List<java.text.DateFormat> dateParsers

activeDateParser

private int activeDateParser
Constructor Detail

FallbackDateParser

public FallbackDateParser()
Creates a new instance.

Method Detail

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