You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a MonetaryAmountFormat that uses the currency unit symbol:
MonetaryAmountFormat format = MonetaryFormats.getAmountFormat(
AmountFormatQueryBuilder.of(Locale.GERMANY)
.set(org.javamoney.moneta.format.CurrencyStyle.SYMBOL)
.set("pattern", "#,##0.##¤")
.build()
);
The java/maven project has a dependency on moneta in runtime (not compile-time) scope. It seems that the class CurrencyStyle and its value SYMBOL are part of moneta, the java-money reference implementation, and not part of the java-money API. Thus, the code does not compile.
I'd prefer to create a MonetaryAmountFormat that uses the currency unit symbol without a compile-time dependency on an implementation.
@vb-chris Do you suggest, CurrencyStyle should probably move to the API here?
We cannot change the API right now without a working Spec Lead or Maintenance Lead, but we're hoping to have a new Money JSR in the near future to deal with those API changes.
Movement of CurrencyStyle seems appropriate to me when all implementations are required to support all options.
For my use case, it would be sufficient when the API defined a Key/Value-Pair of Strings which is respected by implementations.
We have some possible new features for a possible new Money API, trying to use the Configuration API from JSR 382 is among them, not only for this particular case, but others like ExchangeRateProviders, etc.
I'm trying to create a
MonetaryAmountFormat
that uses the currency unit symbol:The java/maven project has a dependency on moneta in runtime (not compile-time) scope. It seems that the class
CurrencyStyle
and its valueSYMBOL
are part of moneta, the java-money reference implementation, and not part of the java-money API. Thus, the code does not compile.I'd prefer to create a
MonetaryAmountFormat
that uses the currency unit symbol without a compile-time dependency on an implementation.(previously asked on Stack Overflow)
The text was updated successfully, but these errors were encountered: