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
CurrencyUnitandMonetaryAmount. - Implementations must also provide a minimal set of roundings, modeled as
MonetaryRounding. This should include basic roundings for ISO currencies, roundings defined byMathContextorRoundingMode. - 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 forMonetaryAmountinstances for a given type.MonetaryOperator Represents an operation on a singleMonetaryAmountthat 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 ofCurrencyUnitinstances.CurrencyContextBuilder Builder class for creating new instances ofCurrencyContextadding detailed information about aCurrencyUnitinstance.CurrencyQuery This class models a query for accessing instances ofCurrencyUnit.CurrencyQueryBuilder Builder for queries for accessingCurrencyUnitinstances.DefaultMonetaryRoundingsSingletonSpi This class models the accessor for rounding instances, modeled asMonetaryOperator.Monetary Factory singleton forCurrencyUnit,MonetaryAmountandMonetaryRoundinginstances 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 ofMonetaryAmountFactoryQuerythat can be passed to accessMonetaryAmountFactoryinstances using a possible complex query.MonetaryContext This class models the meta data (mostly the numeric capabilities) of aMonetaryAmountin a platform independent way.MonetaryContextBuilder Builder class for creating new instances ofMonetaryContextadding detailed information about aMonetaryAmountinstance.NumberValue Instances of this class allow to externalize the numeric value of aMonetaryAmount.RoundingContext This class models the spec/configuration for a rounding, modeled asMonetaryRoundingin a platform independent way.RoundingContextBuilder Builder class for creating new instances ofRoundingContextadding detailed information about aMonetaryRoundinginstance.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.