|
|||||||||
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.
Field Summary | |
---|---|
private boolean |
lenient
|
Constructor Summary | |
---|---|
AbstractNumberFormatter()
|
Method Summary | |
---|---|
protected abstract java.text.NumberFormat |
getNumberFormat(java.util.Locale locale)
Obtain a concrete NumberFormat for the specified locale. |
java.lang.Number |
parse(java.lang.String text,
java.util.Locale locale)
Parse a text String to produce a T. |
java.lang.String |
print(java.lang.Number number,
java.util.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 |
Field Detail |
---|
private boolean lenient
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 java.lang.String print(java.lang.Number number, java.util.Locale locale)
Printer
print
in interface Printer<java.lang.Number>
number
- the instance to printlocale
- the current user locale
public java.lang.Number parse(java.lang.String text, java.util.Locale locale) throws java.text.ParseException
Parser
parse
in interface Parser<java.lang.Number>
text
- the text stringlocale
- the current user locale
java.text.ParseException
- when a parse exception occurs in a java.text parsing libraryprotected abstract java.text.NumberFormat getNumberFormat(java.util.Locale locale)
locale
- the current locale
null
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |