- All Implemented Interfaces:
Formatter<javax.money.CurrencyUnit>
, Parser<javax.money.CurrencyUnit>
, Printer<javax.money.CurrencyUnit>
public class CurrencyUnitFormatter
extends Object
implements Formatter<javax.money.CurrencyUnit>
Formatter for JSR-354 CurrencyUnit
values,
from and to currency code Strings.
- Since:
- 4.2
- Author:
- Juergen Hoeller
-
Constructor Summary
Constructors
-
Method Summary
javax.money.CurrencyUnit
Parse a text String to produce a T.
Print the object of type T for display.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
CurrencyUnitFormatter
public CurrencyUnitFormatter()
-
Method Details
-
print
public String print(javax.money.CurrencyUnit object,
Locale locale)
Description copied from interface: Printer
Print the object of type T for display.
- Specified by:
print
in interface Printer<javax.money.CurrencyUnit>
- Parameters:
object
- the instance to print
locale
- the current user locale
- Returns:
- the printed text string
-
parse
public javax.money.CurrencyUnit parse(String text,
Locale locale)
Description copied from interface: Parser
Parse a text String to produce a T.
- Specified by:
parse
in interface Parser<javax.money.CurrencyUnit>
- Parameters:
text
- the text string
locale
- the current user locale
- Returns:
- an instance of T