public abstract class BaseMonetaryCurrenciesSingletonSpi extends Object implements javax.money.spi.MonetaryCurrenciesSingletonSpi
Monetary
that provides access to
different registered CurrencyProviderSpi
instances.
Implementations of this interface must be thread safe.
Constructor and Description |
---|
BaseMonetaryCurrenciesSingletonSpi() |
Modifier and Type | Method and Description |
---|---|
Set<javax.money.CurrencyUnit> |
getCurrencies(Locale locale,
String... providers)
Provide access to all currently known currencies.
|
Set<javax.money.CurrencyUnit> |
getCurrencies(String... providers)
Provide access to all currently known currencies.
|
javax.money.CurrencyUnit |
getCurrency(javax.money.CurrencyQuery query)
Access a single currency by query.
|
javax.money.CurrencyUnit |
getCurrency(Locale country,
String... providers)
Access a new instance based on the currency code.
|
javax.money.CurrencyUnit |
getCurrency(String currencyCode,
String... providers)
Access a new instance based on the currency code.
|
boolean |
isCurrencyAvailable(Locale locale,
String... providers)
Allows to check if a
CurrencyUnit instance is
defined, i.e. accessible from getCurrency(String, String...) . |
boolean |
isCurrencyAvailable(String code,
String... providers)
Allows to check if a
CurrencyUnit instance is defined, i.e. |
public BaseMonetaryCurrenciesSingletonSpi()
public javax.money.CurrencyUnit getCurrency(String currencyCode, String... providers)
CurrencyProviderSpi
instances registered
with the Bootstrap
.getCurrency
in interface javax.money.spi.MonetaryCurrenciesSingletonSpi
currencyCode
- the ISO currency code, not null
.providers
- the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.CurrencyUnit
instance.javax.money.UnknownCurrencyException
- if no such currency exists.public javax.money.CurrencyUnit getCurrency(Locale country, String... providers)
CurrencyProviderSpi
instances registered
with the Bootstrap
.getCurrency
in interface javax.money.spi.MonetaryCurrenciesSingletonSpi
country
- the ISO currency's country, not null
.providers
- the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.CurrencyUnit
instance.javax.money.UnknownCurrencyException
- if no such currency exists.public Set<javax.money.CurrencyUnit> getCurrencies(Locale locale, String... providers)
getCurrencies
in interface javax.money.spi.MonetaryCurrenciesSingletonSpi
locale
- the target Locale
, typically representing an ISO country,
not null
.providers
- the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.public boolean isCurrencyAvailable(String code, String... providers)
CurrencyUnit
instance is defined, i.e.
accessible from getCurrency(String, String...)
.isCurrencyAvailable
in interface javax.money.spi.MonetaryCurrenciesSingletonSpi
code
- the currency code, not null
.providers
- the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.true
if getCurrency(String, String...)
would return a result for the given code.public boolean isCurrencyAvailable(Locale locale, String... providers)
CurrencyUnit
instance is
defined, i.e. accessible from getCurrency(String, String...)
.isCurrencyAvailable
in interface javax.money.spi.MonetaryCurrenciesSingletonSpi
locale
- the target Locale
, not null
.providers
- the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.true
if getCurrencies(java.util.Locale, String...)
would return a
non empty result for the given code.public Set<javax.money.CurrencyUnit> getCurrencies(String... providers)
getCurrencies
in interface javax.money.spi.MonetaryCurrenciesSingletonSpi
providers
- the (optional) specification of providers to consider. If not set (empty) the providers
as defined by #getDefaultRoundingProviderChain() should be used.public javax.money.CurrencyUnit getCurrency(javax.money.CurrencyQuery query)
getCurrency
in interface javax.money.spi.MonetaryCurrenciesSingletonSpi
query
- The currency query, not null.CurrencyUnit
found, never null.javax.money.MonetaryException
- if multiple currencies match the query.Copyright © 2012-2015 JavaMoney. All Rights Reserved.