提交 39d45507 编写于 作者: J Juergen Hoeller

Update ref doc references to Number/Currency/PercentStyleFormatter

Issue: SPR-17022
上级 833343f1
......@@ -1102,8 +1102,8 @@ should throw a ParseException or IllegalArgumentException if a parse attempt fai
care to ensure your Formatter implementation is thread-safe.
Several Formatter implementations are provided in `format` subpackages as a convenience.
The `number` package provides a `NumberFormatter`, `CurrencyFormatter`, and
`PercentFormatter` to format `java.lang.Number` objects using a `java.text.NumberFormat`.
The `number` package provides a `NumberStyleFormatter`, `CurrencyStyleFormatter`, and
`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
a `java.text.DateFormat`. The `datetime.joda` package provides comprehensive datetime
formatting support based on the http://joda-time.sourceforge.net[Joda-Time library].
......@@ -1203,18 +1203,17 @@ specified:
return configureFormatterFrom(annotation, fieldType);
}
private Formatter<Number> configureFormatterFrom(NumberFormat annotation,
Class<?> fieldType) {
private Formatter<Number> configureFormatterFrom(NumberFormat annotation, Class<?> fieldType) {
if (!annotation.pattern().isEmpty()) {
return new NumberFormatter(annotation.pattern());
return new NumberStyleFormatter(annotation.pattern());
} else {
Style style = annotation.style();
if (style == Style.PERCENT) {
return new PercentFormatter();
return new PercentStyleFormatter();
} else if (style == Style.CURRENCY) {
return new CurrencyFormatter();
return new CurrencyStyleFormatter();
} else {
return new NumberFormatter();
return new NumberStyleFormatter();
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册