ExchangeRateProvider and javax.money.convert.CurrencyConversion instances.
This class is thread safe.
This class is designed to support also contextual behaviour, e.g. in Java EE
containers each application may provide its own ExchangeRateProvider
instances, e.g. by registering them as CDI beans. An EE container can
register an according javax.money.spi.MonetaryConversionsSingletonSpi that manages the
different application contexts transparently. In a SE environment this class
is expected to behave like an ordinary singleton, loading its SPIs e.g. from the
JDK ServiceLoader or an alternate component and service provider.
This class is thread-safe. Hereby it is important to know that it delegates
to the registered javax.money.spi.MonetaryConversionsSingletonSpi SPI, which also is required
to be thread-safe.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CurrencyConversion | Returns: the exchange rate type if this instance.the terminating or target currency, not termCurrency, String... nullAdditional providers, for building a provider chain providers)Access an instance of |
| public static CurrencyConversion | Returns: the exchange rate type if this instance.the terminating or target currency code, not termCurrencyCode, String... nullAdditional providers, for building a provider chain providers)Access an instance of |
| public static CurrencyConversion | Returns: theCurrencyConversion instance matching.The conversionQuery)ConversionQuery required, not nullAccess an instance of |
| public static Collection | Returns: all supported provider ids, nevernull.Return the (non localized) names of all providers available in the current context. |
| public static List | Returns: the default provider, nevernull.Get the default provider used. |
| public static ExchangeRateProvider | Returns: the exchange rate provider.Additional providers, for building a provider chain providers)Access an instance of |
| public static ExchangeRateProvider | Returns: the exchange rate provider.the exchange rate provider. provider, ExchangeRateProviderSupplier... the exchange rate provider. providers)Access an instance of |
| public static ExchangeRateProvider | Returns: the exchange rate provider.the conversionQuery)javax.money.convert.ConversionQuery, not null.Access an instance of |
| private static MonetaryConversionsSingletonSpi | getMonetaryConversionsSpi()
The SPI currently active, use |
| public static boolean | Returns: true, if a conversion is accessible fromgetConversion(ConversionQuery).the conversionQuery)javax.money.convert.ConversionQuery, not null.Checks if a |
| public static boolean | Returns: true, if a conversion is accessible fromgetConversion(String, String...).The currency code, resolvable by currencyCode, String... (String, String...)Additional providers, for building a provider chain providers)Checks if a |
| public static boolean | Returns: true, if a conversion is accessible fromgetConversion(String, String...).the terminating or target currency, not termCurrency, String... nullAdditional providers, for building a provider chain providers)Checks if a |
| public static boolean | Returns: true, if a rate provider is accessible fromgetExchangeRateProvider(ConversionQuery)}.the conversionQuery)javax.money.convert.ConversionQuery, not null.Checks if a |
| MonetaryConversions | back to summary |
|---|---|
| private MonetaryConversions() Private singleton constructor. | |
| getConversion | back to summary |
|---|---|
| public static CurrencyConversion getConversion(CurrencyUnit termCurrency, String... providers) Access an instance of
| |
| getConversion | back to summary |
|---|---|
| public static CurrencyConversion getConversion(String termCurrencyCode, String... providers) Access an instance of
| |
| getConversion | back to summary |
|---|---|
| public static CurrencyConversion getConversion(ConversionQuery conversionQuery) Access an instance of
| |
| getConversionProviderNames | back to summary |
|---|---|
| public static Collection Return the (non localized) names of all providers available in the
current context. Each id can be used to obtain
| |
| getDefaultConversionProviderChain | back to summary |
|---|---|
| public static List Get the default provider used. | |
| getExchangeRateProvider | back to summary |
|---|---|
| public static ExchangeRateProvider getExchangeRateProvider(String... providers) Access an instance of
| |
| getExchangeRateProvider | back to summary |
|---|---|
| public static ExchangeRateProvider getExchangeRateProvider(ExchangeRateProviderSupplier provider, ExchangeRateProviderSupplier... providers) Access an instance of
| |
| getExchangeRateProvider | back to summary |
|---|---|
| public static ExchangeRateProvider getExchangeRateProvider(ConversionQuery conversionQuery) Access an instance of
| |
| getMonetaryConversionsSpi | back to summary |
|---|---|
| private static MonetaryConversionsSingletonSpi getMonetaryConversionsSpi() The SPI currently active, use | |
| isConversionAvailable | back to summary |
|---|---|
| public static boolean isConversionAvailable(ConversionQuery conversionQuery) Checks if a
| |
| isConversionAvailable | back to summary |
|---|---|
| public static boolean isConversionAvailable(String currencyCode, String... providers) Checks if a
| |
| isConversionAvailable | back to summary |
|---|---|
| public static boolean isConversionAvailable(CurrencyUnit termCurrency, String... providers) Checks if a
| |
| isExchangeRateProviderAvailable | back to summary |
|---|---|
| public static boolean isExchangeRateProviderAvailable(ConversionQuery conversionQuery) Checks if a
| |