org.springframework.format.datetime.joda
Class DateTimeParser

java.lang.Object
  extended by org.springframework.format.datetime.joda.DateTimeParser
All Implemented Interfaces:
Parser<org.joda.time.DateTime>

public final class DateTimeParser
extends Object
implements Parser<org.joda.time.DateTime>

Parses Joda Time DateTime instances using a DateTimeFormatter.

Since:
3.0
Author:
Keith Donald

Constructor Summary
DateTimeParser(org.joda.time.format.DateTimeFormatter formatter)
          Create a new DateTimeParser.
 
Method Summary
 org.joda.time.DateTime parse(String text, Locale locale)
          Parse a text String to produce a T.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateTimeParser

public DateTimeParser(org.joda.time.format.DateTimeFormatter formatter)
Create a new DateTimeParser.

Parameters:
formatter - the Joda DateTimeFormatter instance
Method Detail

parse

public org.joda.time.DateTime parse(String text,
                                    Locale locale)
                             throws ParseException
Description copied from interface: Parser
Parse a text String to produce a T.

Specified by:
parse in interface Parser<org.joda.time.DateTime>
Parameters:
text - the text string
locale - the current user locale
Returns:
an instance of T
Throws:
ParseException - when a parse exception occurs in a java.text parsing library