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.
(previously asked on Stack Overflow)
I'm trying to create a
MonetaryAmountFormatthat 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
CurrencyStyleand its valueSYMBOLare 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
MonetaryAmountFormatthat uses the currency unit symbol without a compile-time dependency on an implementation.(previously asked on Stack Overflow)