|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.format.number.AbstractNumberFormatter
public abstract class AbstractNumberFormatter
Abstract formatter for Numbers,
providing a getNumberFormat(java.util.Locale)
template method.
Constructor Summary | |
---|---|
AbstractNumberFormatter()
|
Method Summary | |
---|---|
protected abstract NumberFormat |
getNumberFormat(Locale locale)
Obtain a concrete NumberFormat for the specified locale. |
Number |
parse(String text,
Locale locale)
Parse a text String to produce a T. |
String |
print(Number number,
Locale locale)
Print the object of type T for display. |
void |
setLenient(boolean lenient)
Specify whether or not parsing is to be lenient. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractNumberFormatter()
Method Detail |
---|
public void setLenient(boolean lenient)
With lenient parsing, the parser may allow inputs that do not precisely match the format. With strict parsing, inputs must match the format exactly.
public String print(Number number, Locale locale)
Printer
print
in interface Printer<Number>
number
- the instance to printlocale
- the current user locale
public Number parse(String text, Locale locale) throws ParseException
Parser
parse
in interface Parser<Number>
text
- the text stringlocale
- the current user locale
ParseException
- when a parse exception occurs in a java.text parsing libraryprotected abstract NumberFormat getNumberFormat(Locale locale)
locale
- the current locale
null
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |