Top Description Methods
javax.money.spi

public Interface MonetaryCurrenciesSingletonSpi

Known Direct Implementers
javax.money.DefaultMonetaryCurrenciesSingletonSpi
Imports
javax.money.*, java.util.*

Factory singleton backing interface for javax.money.Monetary that provides access to different registered javax.money.spi.CurrencyProviderSpi instances.

Implementations of this interface must be thread safe.

Author
Anatole Tresch
Version
0.8

Method Summary

Modifier and TypeMethod and Description
public Set<CurrencyUnit>

Returns:

a set of all currencies found, never null.
getCurrencies
(CurrencyQuery
The currency query, not null.
query
)

Access all currencies matching the given query.

public default Set<CurrencyUnit>

Returns:

a collection of all known currencies, never null.
getCurrencies
(Locale
the target java.util.Locale, typically representing an ISO country, not null.
locale
,
String...
the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.
providers
)

Provide access to all currently known currencies.

public default Set<CurrencyUnit>

Returns:

a collection of all known currencies, never null.
getCurrencies
(String...
the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.
providers
)

Provide access to all currently known currencies.

public default CurrencyUnit

Returns:

the corresponding javax.money.CurrencyUnit instance.
getCurrency
(String
the ISO currency code, not null.
currencyCode
,
String...
the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.
providers
)

Access a new instance based on the currency code.

public default CurrencyUnit

Returns:

the corresponding javax.money.CurrencyUnit instance.
getCurrency
(Locale
the ISO currency's country, not null.
country
,
String...
the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.
providers
)

Access a new instance based on the currency code.

public default CurrencyUnit

Returns:

the javax.money.CurrencyUnit found, never null.
getCurrency
(CurrencyQuery
The currency query, not null.
query
)

Access a single currency by query.

public List<String>

Returns:

the currencies returned by the given provider chain. If not provider names are provided the default provider chain configured in javamoney.properties is used.
getDefaultProviderChain
()

Access a list of the currently registered default providers.

public Set<String>

Returns:

the currencies returned by the given provider chain. If not provider names are provided the default provider chain configured in javamoney.properties is used.
getProviderNames
()

Access a list of the currently registered providers.

public default boolean

Returns:

true if javax.money.spi.MonetaryCurrenciesSingletonSpi#getCurrency(String, String...) would return a result for the given code.
isCurrencyAvailable
(String
the currency code, not null.
code
,
String...
the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.
providers
)

Allows to check if a javax.money.CurrencyUnit instance is defined, i.e. accessible from javax.money.spi.MonetaryCurrenciesSingletonSpi#getCurrency(String, String...).

public default boolean

Returns:

true if getCurrencies(java.util.Locale, String...) would return a non empty result for the given code.
isCurrencyAvailable
(Locale
the target java.util.Locale, not null.
locale
,
String...
the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.
providers
)

Allows to check if a javax.money.CurrencyUnit instance is defined, i.e. accessible from getCurrency(String, String...).

Method Detail

getCurrenciesback to summary
public Set<CurrencyUnit> getCurrencies(CurrencyQuery query)

Access all currencies matching the given query.

Parameters
query:CurrencyQuery

The currency query, not null.

Returns:Set<CurrencyUnit>

a set of all currencies found, never null.

getCurrenciesback to summary
public default Set<CurrencyUnit> getCurrencies(Locale locale, String... providers)

Provide access to all currently known currencies.

Parameters
locale:Locale

the target java.util.Locale, typically representing an ISO country, not null.

providers:String[]

the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.

Returns:Set<CurrencyUnit>

a collection of all known currencies, never null.

getCurrenciesback to summary
public default Set<CurrencyUnit> getCurrencies(String... providers)

Provide access to all currently known currencies.

Parameters
providers:String[]

the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.

Returns:Set<CurrencyUnit>

a collection of all known currencies, never null.

getCurrencyback to summary
public default CurrencyUnit getCurrency(String currencyCode, String... providers)

Access a new instance based on the currency code. Currencies are available as provided by javax.money.spi.CurrencyProviderSpi instances registered with the Bootstrap.

Parameters
currencyCode:String

the ISO currency code, not null.

providers:String[]

the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.

Returns:CurrencyUnit

the corresponding javax.money.CurrencyUnit instance.

Exceptions
UnknownCurrencyException:
if no such currency exists.
getCurrencyback to summary
public default CurrencyUnit getCurrency(Locale country, String... providers)

Access a new instance based on the currency code. Currencies are available as provided by javax.money.spi.CurrencyProviderSpi instances registered with the Bootstrap.

Parameters
country:Locale

the ISO currency's country, not null.

providers:String[]

the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.

Returns:CurrencyUnit

the corresponding javax.money.CurrencyUnit instance.

Exceptions
UnknownCurrencyException:
if no such currency exists.
getCurrencyback to summary
public default CurrencyUnit getCurrency(CurrencyQuery query)

Access a single currency by query.

Parameters
query:CurrencyQuery

The currency query, not null.

Returns:CurrencyUnit

the javax.money.CurrencyUnit found, never null.

Exceptions
MonetaryException:
if multiple currencies match the query.
getDefaultProviderChainback to summary
public List<String> getDefaultProviderChain()

Access a list of the currently registered default providers. The default providers are used, when no provider names are passed by the caller.

Returns:List<String>

the currencies returned by the given provider chain. If not provider names are provided the default provider chain configured in javamoney.properties is used.

See Also
getCurrencies(String...), javax.money.CurrencyQueryBuilder
getProviderNamesback to summary
public Set<String> getProviderNames()

Access a list of the currently registered providers. The names can be used to access subsets of the overall currency range by calling getCurrencies(String...).

Returns:Set<String>

the currencies returned by the given provider chain. If not provider names are provided the default provider chain configured in javamoney.properties is used.

isCurrencyAvailableback to summary
public default boolean isCurrencyAvailable(String code, String... providers)

Allows to check if a javax.money.CurrencyUnit instance is defined, i.e. accessible from javax.money.spi.MonetaryCurrenciesSingletonSpi#getCurrency(String, String...).

Parameters
code:String

the currency code, not null.

providers:String[]

the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.

Returns:boolean

true if javax.money.spi.MonetaryCurrenciesSingletonSpi#getCurrency(String, String...) would return a result for the given code.

isCurrencyAvailableback to summary
public default boolean isCurrencyAvailable(Locale locale, String... providers)

Allows to check if a javax.money.CurrencyUnit instance is defined, i.e. accessible from getCurrency(String, String...).

Parameters
locale:Locale

the target java.util.Locale, not null.

providers:String[]

the (optional) specification of providers to consider. If not set (empty) the providers as defined by #getDefaultCurrencyProviderChain() should be used.

Returns:boolean

true if getCurrencies(java.util.Locale, String...) would return a non empty result for the given code.