Skip to main content
This revision made December 23, 2013 14:18, by Anatole

JSR 354 - Currency and Money

Latest News

  • Public Review published at Public Review. Ballot will be in January 2014.
  • Due to important feedback, we will publish another Public Review soon after the ballot. Check our GitHub repo for a latest update.


This JSR focuses on defining interfaces and classes to be used for currencies and monetary amounts. Generally the following areas are focused:

  • Core This area defines the classes representing currencies and monetary amounts.
  • Conversion This area deals with exchange rates between currencies and provides an API/SPI to perform conversion of monetary amounts from one currency to another.
  • Format This area defines APIs/SPIs for formatting and parsing of currencies and monetary amounts, providing support for complex usage scenarios.
  • Extensions This area adds extended functionality like currency services, currency mapping, regions and validity services (historic data API).

All this areas were implemented in the org.javamoney OSS GItHub project, the common essence finally defined what we have now as JSR 354:

  • Interfaces CurrencyUnit, MonetaryAmount, MonetaryAdjuster, MonetaryQuery
  • MonetaryException runtime exception class.

An implementation of this small API is completely enough as a base for all the requirements above.

Beside the latest specification you may also find useful information and examples on the JSR 354 blog

It is planned the the JSR will support both SE environments, but also ME usage scenarios should be considered. The reference implementation probably also will include support for EE/CDI based on a flexible and adaptable SPI design.

Scope and Use Cases

Generally the scope of the JSR is targeting all general application types, e.g.

  • eCommerce
  • Banking and finance
  • Investment
  • Insurance and Pension
  • Mobile and Embedded Payment
  • etc.

Summarizing the scope can be defined as follows:

  • Provide abstractions for currency and money suitable for all target applications
  • Enhance, renew Currency, add support for non-ISO currencies
  • Support complex calculation rules including calculation precision and display precision
  • Support for regional rounding rules
  • Basic support for foreign exchange, extendable for more complex usage scenarios
  • A plain text representation of Money
  • Printing/Parsing to String
  • Support for pluralization
  • Provide APIs for historic access of currencies and exchange rates.
  • Define a flexible query API tu support complex usage scenarios for exchange rates and currencies
  • Storing a value in multiple currencies (a single value type that is effectively a map of currency to amount, where the amounts are all notionally the same by some form of currency conversion)
  • Large exchange rate system (as in a system suitable for trading, such as bid/ask)

Nevertheless there are some restrictions (features that are not in scope):

Further Information and Source Code Access

  • The current specification document is in work - The latest from EDR is locateted at EDR, but be aware that there are a couple of changes not reflected in this document.
  • Current Build Status and Build Information CloudBees
  • Public Source Code Repository on GitHub: GitHub Repository
  • Discussions about Precision and other Implementation notes
Difference compared to previous revision
JSR 354 - Currency and Money

Latest News

  • WePublic wRevillew published at Public Review. publish Public Review s Balloont will aft bere in JavaOneJanuary 20134.
  • WDue were ntom inmportant feedback,ated for wetwo will publish <b> another Public Review soon ahref="hfter ttp://jcpthe ballot. Check GitHub ren/epo fopress/news/r aw lrds/2013award_nomintees">JCPest awarupdsa>date.
== Introduction
Please Confirm