Class AbstractNumberFormatter
java.lang.Object
org.springframework.format.number.AbstractNumberFormatter
- Direct Known Subclasses:
- CurrencyStyleFormatter, NumberStyleFormatter, PercentStyleFormatter
Abstract formatter for Numbers,
providing a 
getNumberFormat(java.util.Locale) template method.- Since:
- 3.0
- Author:
- Juergen Hoeller, Keith Donald
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract NumberFormatgetNumberFormat(Locale locale) Obtain a concrete NumberFormat for the specified locale.Parse a text String to produce a T.Print the object of type T for display.voidsetLenient(boolean lenient) Specify whether parsing is to be lenient.
- 
Constructor Details- 
AbstractNumberFormatterpublic AbstractNumberFormatter()
 
- 
- 
Method Details- 
setLenientpublic void setLenient(boolean lenient) Specify whether parsing is to be lenient. Default isfalse.With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly. 
- 
print
- 
parseDescription copied from interface:ParserParse a text String to produce a T.- Specified by:
- parsein interface- Parser<Number>
- 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
 
- 
getNumberFormatObtain a concrete NumberFormat for the specified locale.- Parameters:
- locale- the current locale
- Returns:
- the NumberFormat instance (never null)
 
 
-