Skip to main content
This revision made September 03, 2013 22:30, by Anatole


JSR 354 - Currency and Money


Introduction

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

  • 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).

Beside the latest specification you may also find useful information and examples on the JSR 354 blog http://jsr354.blogspot.ch/.

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
<span>* '''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 <span style="text-decoration:underline;color:green">a</span>d<span style="text-decoration:underline;color:green">ds </span>=<img align="right" src="http://asset-1.java.net/attachments/images/project/javamoney.png?20121214.f926c51"/> <br/>JSR 354 - Currency and Money<br/><br/><br/> == Introduction This JSR focuses on defining interfaces and classes to be used for currencies and monetary amounts. Generally the following areas are defined: * '''Core''' This area defines the classes representing currencies and monetary amounts. ... * '''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 de<span style="text-decoration:line-through;color:red">fi</span>e<span style="text-decoration:underline;color:green">xte</span>n<span style="text-decoration:underline;color:green">d</span>ne<span style="text-decoration:line-through;color:red">s a</span>d<span style="text-decoration:line-through;color:red">di</span>ed<span style="text-decoration:underline;color:green"> func</span>tional<span style="text-decoration:underline;color:green">ity</span>tional <span style="text-decoration:line-through;color:red">f</span> <span style="text-decoration:underline;color:green">like c</span>u<span style="text-decoration:underline;color:green">rre</span>unc<span style="text-decoration:line-through;color:red">t</span>nc<span style="text-decoration:underline;color:green">y serv</span>i<span style="text-decoration:underline;color:green">ces, currency mapping, regi</span>ions and <span style="text-decoration:line-through;color:red">u</span>ons and <span style="text-decoration:underline;color:green">validi</span>t<span style="text-decoration:underline;color:green">y serv</span>ti<span style="text-decoration:line-through;color:red">l</span>i<span style="text-decoration:underline;color:green">ces (h</span><span style="text-decoration:underline;color:green">s</span>t<span style="text-decoration:underline;color:green">or</span>i<span style="text-decoration:underline;color:green">c data API). B</span>es<span style="text-decoration:underline;color:green">ide</span> th<span style="text-decoration:underline;color:green">e l</span>at<span style="text-decoration:underline;color:green">est</span>ities that <span style="text-decoration:line-through;color:red">ar</span> <span style="text-decoration:underline;color:green">sp</span>e<span style="text-decoration:underline;color:green">cification</span> <span style="text-decoration:underline;color:green">yo</span>u<span style="text-decoration:underline;color:green"> may al</span>s<span style="text-decoration:underline;color:green">o find us</span>eful <span style="text-decoration:underline;color:green">inform</span>a<span style="text-decoration:underline;color:green">tio</span>n<span style="text-decoration:underline;color:green"> an</span>e useful and <span style="text-decoration:line-through;color:red">f</span>d e<span style="text-decoration:underline;color:green">x</span>a<span style="text-decoration:underline;color:green">mple</span>eas<span style="text-decoration:line-through;color:red">i</span>s<span style="text-decoration:underline;color:green"> on the JSR 354 </span>bl<span style="text-decoration:line-through;color:red">e</span><span style="text-decoration:underline;color:green">og [http://jsr354</span>.<span style="text-decoration:underline;color:green">blogspot.ch/].</span>. It is planned the the JSR will support both SE <span style="text-decoration:line-through;color:red">and ME </span> It is planned the the JSR will support both SE environments<span style="text-decoration:underline;color:green">, but also ME usage scenarios should be considered</span>environments. The reference implementation probably also will include <span style="text-decoration:line-through;color:red">further </span>. The reference implementation probably also will include support for EE/CDI<span style="text-decoration:underline;color:green"> based on a flexible and adaptable SPI design</span>. ==Scope and Use Cases ... * Non-decimal currencies [http://en.wikipedia.org/wiki/Non-decimal_currency#Contemporary_non-decimal_currencies] ==Further Information and Source Code Access * The current specification document <span style="text-decoration:underline;color:green">is in work </span>- <span style="text-decoration:underline;color:green">The latest from EDR is locateted at </span>[http://jcp.org/aboutJava/communityprocess/edr/jsr354/index.html EDR]<span style="text-decoration:underline;color:green">, but be aware that there are a couple of changes not reflected in this document.</span> * Current Build Status and Build Information [https://jsr354.ci.cloudbees.com/job/javamoney/ CloudBees] * Public Source Code Repository on GitHub: [https://github.com/JavaMoney/javamoney GitHub Repository] * Discussions about [[Precision]] and other [[implementation|Implementation notes]]<span>
 
 
Close
loading
Please Confirm
Close