Update ref doc references to Number/Currency/PercentStyleFormatter
Issue: SPR-17022
This commit is contained in:
parent
833343f17c
commit
39d455073a
|
|
@ -1102,8 +1102,8 @@ should throw a ParseException or IllegalArgumentException if a parse attempt fai
|
||||||
care to ensure your Formatter implementation is thread-safe.
|
care to ensure your Formatter implementation is thread-safe.
|
||||||
|
|
||||||
Several Formatter implementations are provided in `format` subpackages as a convenience.
|
Several Formatter implementations are provided in `format` subpackages as a convenience.
|
||||||
The `number` package provides a `NumberFormatter`, `CurrencyFormatter`, and
|
The `number` package provides a `NumberStyleFormatter`, `CurrencyStyleFormatter`, and
|
||||||
`PercentFormatter` to format `java.lang.Number` objects using a `java.text.NumberFormat`.
|
`PercentStyleFormatter` to format `java.lang.Number` objects using a `java.text.NumberFormat`.
|
||||||
The `datetime` package provides a `DateFormatter` to format `java.util.Date` objects with
|
The `datetime` package provides a `DateFormatter` to format `java.util.Date` objects with
|
||||||
a `java.text.DateFormat`. The `datetime.joda` package provides comprehensive datetime
|
a `java.text.DateFormat`. The `datetime.joda` package provides comprehensive datetime
|
||||||
formatting support based on the http://joda-time.sourceforge.net[Joda-Time library].
|
formatting support based on the http://joda-time.sourceforge.net[Joda-Time library].
|
||||||
|
|
@ -1203,18 +1203,17 @@ specified:
|
||||||
return configureFormatterFrom(annotation, fieldType);
|
return configureFormatterFrom(annotation, fieldType);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Formatter<Number> configureFormatterFrom(NumberFormat annotation,
|
private Formatter<Number> configureFormatterFrom(NumberFormat annotation, Class<?> fieldType) {
|
||||||
Class<?> fieldType) {
|
|
||||||
if (!annotation.pattern().isEmpty()) {
|
if (!annotation.pattern().isEmpty()) {
|
||||||
return new NumberFormatter(annotation.pattern());
|
return new NumberStyleFormatter(annotation.pattern());
|
||||||
} else {
|
} else {
|
||||||
Style style = annotation.style();
|
Style style = annotation.style();
|
||||||
if (style == Style.PERCENT) {
|
if (style == Style.PERCENT) {
|
||||||
return new PercentFormatter();
|
return new PercentStyleFormatter();
|
||||||
} else if (style == Style.CURRENCY) {
|
} else if (style == Style.CURRENCY) {
|
||||||
return new CurrencyFormatter();
|
return new CurrencyStyleFormatter();
|
||||||
} else {
|
} else {
|
||||||
return new NumberFormatter();
|
return new NumberStyleFormatter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue