Top Description Constructors Methods
org.springframework.format.datetime.standard

pack-priv Class PeriodFormatter

extends Object
implements Formatter<Period>
Class Inheritance
All Implemented Interfaces
org.springframework.format.Formatter, org.springframework.format.Parser, org.springframework.format.Printer
Imports
java.text.ParseException, java.time.Period, java.util.Locale, org.springframework.format.Formatter

Formatter implementation for a JSR-310 Period, following JSR-310's parsing rules for a Period.
Author
Juergen Hoeller
Since
4.2.4
See Also
Period#parse

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Period
parse(String
the text string
text
,
Locale
the current user locale
locale
)

Implements org.springframework.format.Parser.parse.

Parse a text String to produce a T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PeriodFormatterback to summary
pack-priv PeriodFormatter()

Method Detail

parseback to summary
public Period parse(String text, Locale locale) throws ParseException

Implements org.springframework.format.Parser.parse.

Doc from org.springframework.format.Parser.parse.

Parse a text String to produce a T.

Parameters
text:String

the text string

locale:Locale

the current user locale

Returns:Period

an instance of T

Annotations
@Override
Exceptions
ParseException:
when a parse exception occurs in a java.text parsing library