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
{{ message }}
This repository was archived by the owner on Jun 27, 2021. It is now read-only.
@@ -88,31 +81,32 @@ public class MyImplClass extends BaseCurrencyProviderSpi{
88
81
[[ProjectStructure]]
89
82
== Package and Project Structure
90
83
==== Package Overview
91
-
Similar to JSR 354 the backport defines the following 4 main packages:
84
+
Similar to JSR 354 Java 8 API this the Java 7 API defines 4 main packages:
92
85
93
-
+org.javamoney.bp.api+:: contains the main artifacts, such as +CurrencyUnit, MonetaryAmount, MonetaryContext, MonetaryOperator,
94
-
MonetaryQuery, MonetaryRounding+, and the singleton accessors +MonetaryCurrencies, MonetaryAmounts, MonetaryRoundings+.
86
+
+javax.money+:: contains the main artifacts, such as +CurrencyUnit, MonetaryAmount, MonetaryContext, MonetaryOperator,
87
+
MonetaryQuery, MonetaryRounding+, and the singleton accessor +Monetary+.
95
88
96
-
+org.javamoney.bp.api.conversion+:: contains the conversion artifacts +ExchangeRate, ExchangeRateProvider, CurrencyConversion+
89
+
+javax.money.conversion+:: contains the conversion artifacts +ExchangeRate, ExchangeRateProvider, CurrencyConversion+
97
90
and the according +MonetaryConversions+ accessor singleton.
98
91
99
-
+org.javamoney.bp.api.format+:: contains the formatting artifacts +MonetaryAmountFormat, AmountFormatContext+ and the according
92
+
+javax.money.format+:: contains the formatting artifacts +MonetaryAmountFormat, AmountFormatContext+ and the according
100
93
+MonetaryFormats+ accessor singleton.
101
94
102
-
+org.javamoney.bp.api.spi+:: contains the SPI interfaces provided by the JSR 354 API and the bootstrap logic, to support
95
+
+javax.money.spi+:: contains the SPI interfaces provided by the JSR 354 API and the bootstrap logic, to support
103
96
different runtime environments and component loading mechanisms.
104
97
105
98
106
99
[[Modules]]
107
100
==== Module/Repository Overview
108
101
The JSR’s source code repository under <<source>> provides several modules:
109
102
110
-
javamoney-api-bp:: contains the API backport for use with Java 7.
111
-
javamoney-moneta-bp:: contains the ''moneta'' implementation, based on Java 7.
103
+
jsr354-api-bp:: contains the API backport compatible with Java g and 7.
104
+
jsr354-ri-bp:: contains the ''moneta'' implementation, based on Java 7.
112
105
jsr354-api:: contains the JSR 354 API for use with Java 8. We highly recommend using this version, if possible, to
113
106
benefit from the power of Java 8.
114
107
jsr354-ri:: contains the ''moneta'' reference implementation, based on Java 8.
115
-
jsr354-tck:: contains the technical compatibility kit (TCK) of the JSR, requiring as well Java 8.
108
+
jsr354-tck:: contains the technical compatibility kit (TCK) of the JSR, requiring as well Java 7. The TCK is the same
109
+
for Java 7 and Java 8.
116
110
javamoney-parent:: is a root “POM” project for all modules under +org.javamoney+. This includes the RI/TCK projects,
117
111
but not jsr354-api and javamoney-api-bp (which are standalone).
118
112
javamoney-library:: contains a financial library (JavaMoney) adding comprehensive support for several extended
@@ -121,14 +115,14 @@ javamoney-examples:: finally contains the examples and demos, and also is not pa
121
115
122
116
123
117
== Examples
124
-
The following sections illustrate the backport's API usage in more detail.
118
+
The following sections illustrate the API usage in more detail.
125
119
126
-
=== Working with org.javamoney.moneta.bp.Money
127
-
The Javamoney backport implementation of JSR 354 has to provide value type classes for monetary amounts, hereby implementing
128
-
+org.javamoney.moneta.bp.api.MonetaryAmount+, and registering at least one implementation class with the +org.javamoney.moneta.bp.api.MonetaryAmounts+ singleton by
129
-
implementing and registering a corresponding +org.javamoney.moneta.bp.api.MonetayAmountFactory+ instance.
120
+
=== Working with javax.money.Money
121
+
The Java 7 based implementation of JSR 354 has to provide value type classes for monetary amounts, hereby implementing
122
+
+javax.money.MonetaryAmount+, and registering at least one implementation class with the +javax.money.Monetary+
123
+
singleton by implementing and registering a corresponding +javax.money.MonetayAmountFactory+ instance.
130
124
131
-
As an example the reference implementation provides a class +org.javamoney.moneta.bp.Money+, which is using
125
+
As an example the reference implementation provides a class +org.javamoney.moneta.Money+, which is using
132
126
+java.math.BigDecimal+ internally:
133
127
134
128
[source,java]
@@ -246,7 +240,7 @@ Below is a rather academical example of a +MonetaryOperator+ that simply convert
246
240
the same numeric value, but with XXX (undefined) as currency:
247
241
248
242
[source,java]
249
-
.Simple example of a +MonetaryOperstor+ using the +MonetaryAmountFactory+ provided.
243
+
.Simple example of a +MonetaryOperator+ using the +MonetaryAmountFactory+ provided.
* http://javamoney.org[JavaMoney] is the Apache 2.0 licensed OSS project that evolved from JSR 354 development. It provides concrete implementations for currency conversion and mapping, advanced formatting, historic data access, regions and a set of financial calculations and formulas.
505
-
* http://www.joda.org/joda-money[Joda Money] can be referred to as an inspiration for API and design style. it is based on real-world use cases in an e-commerce application for airlines
506
-
* http://grails.org/plugin/currencies[Grails Currencies] uses BigDecimal as internal representation, but API only exposes Number in all Money operations like plus(), minus() or similar.
507
-
* http://lemnik.wordpress.com/2011/03/25/bigdecimal-and-your-money/[Why not to use BigDecimal for Money]
508
-
* http://de.wikipedia.org/wiki/M-Pesa[M-Pesa-Mobile Money] in Africa
509
-
* Currency Internationalization (i18n), Multiple Currencies and Foreign Exchange (FX).
510
-
* http://en.wikipedia.org/wiki/Japanese_units_of_measurement#Money: Discussion of internationalization of currencies, rounding, grouping and formatting, separators etc]
511
-
* http://speleotrove.com/decimal/
512
-
* http://sourceforge.net/projects/oquote/
513
-
* http://en.wikipedia.org/wiki/Karatsuba_algorithm[Karatsuba Algorithm] for Fast Big Decimal Multiplication
514
-
515
-
=== Related Initiatives
516
-
* http://timeandmoney.sourceforge.net/ [Eric Evans Time and Money Library]
0 commit comments