Class DateTimeParser
- java.lang.Object
- org.springframework.format.datetime.joda.DateTimeParser
public final class DateTimeParser extends Object implements Parser<DateTime>
Parses JodaDateTimeinstances using aDateTimeFormatter.- Since:
- 3.0
- Author:
- Keith Donald
Constructor Summary
Constructors Constructor Description DateTimeParser(DateTimeFormatter formatter)Create a new DateTimeParser.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeparse(String text, Locale locale)Parse a text String to produce a T.
Constructor Detail
DateTimeParser
public DateTimeParser(DateTimeFormatter formatter)
Create a new DateTimeParser.- Parameters:
formatter- the Joda DateTimeFormatter instance
Method Detail
parse
public DateTime parse(String text, Locale locale) throws ParseException
Description copied from interface:ParserParse a text String to produce a T.- Specified by:
parsein interfaceParser<DateTime>- Parameters:
text- the text stringlocale- the current user locale- Returns:
- an instance of T
- Throws:
ParseException- when a parse exception occurs in a java.text parsing library