Class LocalDateTimeParser
- java.lang.Object
- org.springframework.format.datetime.joda.LocalDateTimeParser
- All Implemented Interfaces:
Parser<LocalDateTime>
public final class LocalDateTimeParser extends Object implements Parser<LocalDateTime>
Parses JodaLocalDateTime
instances using aDateTimeFormatter
.- Since:
- 4.0
- Author:
- Juergen Hoeller
Constructor Summary
Constructors Constructor Description LocalDateTimeParser(DateTimeFormatter formatter)
Create a new DateTimeParser.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalDateTime
parse(String text, Locale locale)
Parse a text String to produce a T.
Constructor Detail
LocalDateTimeParser
public LocalDateTimeParser(DateTimeFormatter formatter)
Create a new DateTimeParser.- Parameters:
formatter
- the Joda DateTimeFormatter instance
Method Detail
parse
public LocalDateTime parse(String text, Locale locale) throws ParseException
Description copied from interface:Parser
Parse a text String to produce a T.- Specified by:
parse
in interfaceParser<LocalDateTime>
- 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