类 MonetaryAmountFormatter
java.lang.Object
cn.taketoday.format.number.money.MonetaryAmountFormatter
- 所有已实现的接口:
Formatter<javax.money.MonetaryAmount>,Parser<javax.money.MonetaryAmount>,Printer<javax.money.MonetaryAmount>
public class MonetaryAmountFormatter
extends Object
implements Formatter<javax.money.MonetaryAmount>
Formatter for JSR-354
MonetaryAmount values,
delegating to MonetaryAmountFormat.format(javax.money.MonetaryAmount)
and MonetaryAmountFormat.parse(java.lang.CharSequence).- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller
- 另请参阅:
-
构造器概要
构造器构造器说明Create a locale-driven MonetaryAmountFormatter.MonetaryAmountFormatter(String formatName) Create a new MonetaryAmountFormatter for the given format name. -
方法概要
修饰符和类型方法说明protected javax.money.format.MonetaryAmountFormatgetMonetaryAmountFormat(Locale locale) Obtain a MonetaryAmountFormat for the given locale.javax.money.MonetaryAmountParse a text String to produce a T.Print the object of type T for display.voidsetFormatName(String formatName) Specify the format name, to be resolved by the JSR-354 provider at runtime.
-
构造器详细资料
-
MonetaryAmountFormatter
public MonetaryAmountFormatter()Create a locale-driven MonetaryAmountFormatter. -
MonetaryAmountFormatter
Create a new MonetaryAmountFormatter for the given format name.- 参数:
formatName- the format name, to be resolved by the JSR-354 provider at runtime
-
-
方法详细资料
-
setFormatName
Specify the format name, to be resolved by the JSR-354 provider at runtime.Default is none, obtaining a
MonetaryAmountFormatbased on the current locale. -
print
从接口复制的说明:PrinterPrint the object of type T for display. -
parse
从接口复制的说明:ParserParse a text String to produce a T. -
getMonetaryAmountFormat
Obtain a MonetaryAmountFormat for the given locale.The default implementation simply calls
MonetaryFormats.getAmountFormat(java.util.Locale, java.lang.String...)with either the configured format name or the given locale.- 参数:
locale- the current locale- 返回:
- the MonetaryAmountFormat (never
null) - 另请参阅:
-