Module java.money
Package javax.money
Main package of the Money and Currency API. In more detail:
- JSR 354 defines a minimal set of interfaces for interoperability, since concrete usage scenarios do not allow to define an implementation that is capable of covering all aspects identified. Consequently it must be possible that implementations can provide several implementations for monetary amounts. Users should not reference the interfaces, instead the value types should be used.
- Implementations must provide value types for currencies and amounts,
implementing
CurrencyUnit
andMonetaryAmount
. - Implementations must also provide a minimal set of roundings, modeled as
MonetaryRounding
. This should include basic roundings for ISO currencies, roundings defined byMathContext
orRoundingMode
. - This API must avoid restrictions that prevents its use in different runtime environments, such as EE or ME.
- Method naming and style for currency modeling should be in alignment
with parts of the Java Collection API or
java.time
/ [JodaMoney].
-
Interface Summary Interface Description CurrencySupplier Represents a supplier ofCurrencyUnit
-valued results.CurrencyUnit A unit of currency.MonetaryAmount Interface defining a monetary amount.MonetaryAmountFactory<T extends MonetaryAmount> Factory forMonetaryAmount
instances for a given type.MonetaryOperator Represents an operation on a singleMonetaryAmount
that produces a result of typeMonetaryAmount
.MonetaryQuery<R> Strategy for querying a monetary amount.MonetaryRounding Interface representing a monetary rounding.NumberSupplier Represents a supplier ofNumberValue
-valued results. -
Class Summary Class Description AbstractContext Represents a general context of data targeting an item of typeQ
.AbstractContextBuilder<B extends AbstractContextBuilder,C extends AbstractContext> This interface defines the common generic parts of a query.AbstractQuery Represents a general context of data targeting an item of typeQ
.AbstractQueryBuilder<B extends AbstractQueryBuilder,C extends AbstractQuery> This abstract class defines the common generic parts of a query.CurrencyContext This class models the attributable context ofCurrencyUnit
instances.CurrencyContextBuilder Builder class for creating new instances ofCurrencyContext
adding detailed information about aCurrencyUnit
instance.CurrencyQuery This class models a query for accessing instances ofCurrencyUnit
.CurrencyQueryBuilder Builder for queries for accessingCurrencyUnit
instances.DefaultMonetaryRoundingsSingletonSpi This class models the accessor for rounding instances, modeled asMonetaryOperator
.Monetary Factory singleton forCurrencyUnit
,MonetaryAmount
andMonetaryRounding
instances as provided by the different registered SPI instances.MonetaryAmountFactoryQuery Query to lookup instances ofMonetaryAmountFactory
, which are determined by the (minimal) capabilities required by the give use case.MonetaryAmountFactoryQueryBuilder Builder class for creating new instances ofMonetaryAmountFactoryQuery
that can be passed to accessMonetaryAmountFactory
instances using a possible complex query.MonetaryContext This class models the meta data (mostly the numeric capabilities) of aMonetaryAmount
in a platform independent way.MonetaryContextBuilder Builder class for creating new instances ofMonetaryContext
adding detailed information about aMonetaryAmount
instance.NumberValue Instances of this class allow to externalize the numeric value of aMonetaryAmount
.RoundingContext This class models the spec/configuration for a rounding, modeled asMonetaryRounding
in a platform independent way.RoundingContextBuilder Builder class for creating new instances ofRoundingContext
adding detailed information about aMonetaryRounding
instance.RoundingQuery Query for accessing instances ofMonetaryRounding
.RoundingQueryBuilder Builder used to construct new instances of RoundingQuery}. -
Exception Summary Exception Description MonetaryException Exception thrown when an error occurs during monetary operations.UnknownCurrencyException Exception thrown when a currency code cannot be resolved into aCurrencyUnit
.