Skip to main content

[JSR-354] Re: Getting a name method into CurrencyUnit

  • From: Werner Keil <werner.keil@...>
  • To: jcurrency_mail@...
  • Subject: [JSR-354] Re: Getting a name method into CurrencyUnit
  • Date: Thu, 18 Apr 2013 13:59:23 +0200

Roger mentioned CLDR for Timezones, and there is quite a number of Unicode provided standards there:
or
http://unicode.org/repos/cldr/trunk/common/supplemental/supplementalData.xml
(mapping currencies to regions) 

but most importantly this one

CLDR does have a field it calls "description". Whether or not we should hold such information, well, I guess i18n team and others at OpenJDK could tell, if we do similar to what TemporalUnit does, then even though it is English and sometimes a bit verbose (like "Albanian Lek (1946-1965)") there should be a getter for it, regardless of its exact name.

Regards,
Werner

On Thu, Apr 18, 2013 at 1:20 PM, Werner Keil <werner.keil@...> wrote:
Anatole/all,

Beside a very interesting coincidence of an isVirtual() flag in the API, the most popular Bitcoin exchange Mt.Gox has this JSON structure for CurrencyInformation, see the Java mapping on Github:

    private String currency_code;
    private String name;
    private String symbol;
    private int decimals;
    private int display_decimals;
    private String symbol_position;
    private boolean virtual;

We cover quite a few of them in CurrencyUnit, and should a diversion and fragmentation into things like
java.util.Currency.getDisplayName(), javax.money.MoneyCurrency[noName] and something like net.java.javamoney.bitcoin.MtGoxCurrency.getName() be the preference, sure, it won't make it as easy to handle such attributes in a more common and convenient way, but if that's the broad consensus that we don't want such property in the public API, then be it.

Roger, the co Spec Lead of 310 who integrates the former JSR into OpenJDK for Oracle said, the locale-insensitive variants of e.g. getName() in TemporalUnit and similar elements are driven by a standard data format, date, time and timezone information is provided by to the JDK. 

Similar data for currencies in Java may not come from just a single place, see the blog of Naoto Sato, AFAIK still i18n lead of OpenJDK: https://blogs.oracle.com/naotoj/entry/currency_enhancements_in_jdk71

Please pay special attention to the last part where somebody suggested using JSR-275 to her, and her response 
I agree that it would be convenient to have a capability for monetary exchange, though. And if that monetary implementation of JScience would be to be incorporated into the JDK, definitely we need to seamlessly integrate them.

Looks like we should have a chat with the JDK i18n team, and if this view hasn't changed since 2007, they seem quite open to even the "convert" functionality of JSR 354 to be incorporated into the JDK

Regards,
Werner



[JSR-354] Getting a name method into CurrencyUnit

Werner Keil 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Stephen Colebourne 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Anatole Tresch 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/17/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Simon Martinelli 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Simon Martinelli 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Anatole Tresch 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Sascha Freitag 04/20/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Chris Pheby 04/18/2013

[JSR-354] Re: Getting a name method into CurrencyUnit

Werner Keil 04/18/2013
 
 
Close
loading
Please Confirm
Close