-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapi.html
More file actions
84 lines (71 loc) · 3.49 KB
/
api.html
File metadata and controls
84 lines (71 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
title=API (JSR 354)
date=2020-06-16
type=page
status=published
~~~~~~
<h2>Money & Currency API</h2>
<section id="downloads" class="clearfix">
<a href="https://github.com/JavaMoney/jsr354-api/zipball/master"
id="download-zip" class="button"><span>Download .zip</span></a> <a
href="https://github.com/JavaMoney/jsr354-api/tarball/master"
id="download-tar-gz" class="button"><span>Download .tar.gz</span></a>
<a href="https://github.com/JavaMoney/jsr354-api" id="view-on-github"
class="button"><span>View on GitHub</span></a>
</section>
<hr>
<section id="main_content">
<h3>
<a name="what-is-jsr-354"
class="anchor"
href="#what-is-jsr-354"><span
class="octicon octicon-link"></span></a>What is JSR 354?
</h3>
<p>JSR 354 provides a portable and extendible framework for handling of Money & Currency. The API
models monetary amounts and currencies in a platform independent and portable way, including well
defined extension points. It's API defines a simple yet flexible contract that enables users to choose
the implementation matching their target requirements best and having full control about the numeric state
at all stages during monetary processing. <br/>
The JSR is lead by Trivadis AG (<a href="https://www.trivadis.com" class="user-mention">trivadis.com</a>), Werner Keil (<a href="https://github.com/keilw" class="user-mention">@keilw</a>) and Otavio Santana (<a href="https://github.com/otaviojava" class="user-mention">@otaviojava</a>)
<br/>You can access the API by adding the following Maven
dependencies:</p>
<pre><code><dependency>
<groupId>javax.money</groupId>
<artifactId>money-api</artifactId>
<version>1.1</version>
</dependency>
</code></pre>
<p>Further versions can be found <a href="http://mvnrepository.com/artifact/javax.money/money-api/" target="_blank">here</a>.</p>
<p>
The release artifacts should be accessible from the following repositories:
<ul>
<li>Maven Central</li>
</ul>
</p>
<p>Though it is possible to compile your programs completely with the API, in most cases, you will also have to
add an implementation, e.g. the <a href="ri.html">Moneta</a> reference implementation.</p>
<h3>
<a name="overview" class="anchor"
href="#overview"><span
class="octicon octicon-link"></span></a>Overview
</h3>
<p>
The API basically consists of four packages:
<ul>
<li><code>javax.money</code> contains the main artifacts of the API, e.g. the interfaces for <code>MonetaryAmount</code>, <code>CurrencyUnit</code>, <code>MonetaryOperator</code>, <code>MonetaryQuery</code>, and the
accessor singletons for amounts, currencies and roundings.</li>
<li><code>javax.money.convert</code> contains currency conversion logic.</li>
<li><code>javax.money.format</code> contains the formatting logic, which has some similarities with <code>java.text</code> but relies
more on immutable artifacts and builders.</li>
<li><code>javax.money.spi</code> contains the service provider interfaces and the bootstrap logic, which allows to configure the API
also within EE contexts (e.g. running it within a CDI container).</li>
</ul>
The Java 9 "Jigsaw" module is <code>java.money</code>.
</p>
<h3>
<a name="documentation" class="anchor" href="#documentation"><span
class="octicon octicon-link"></span></a>Documentation
</h3>
<p>
Since it a Java Specification Request check out out JSR's specification from the <a href="https://jcp.org/en/jsr/detail?id=354">JSR 354 Detail Page</a>.
</p>
</section>