Top Description Constructors Methods
org.javamoney.moneta.spi

public Class DefaultMonetaryCurrenciesSingletonSpi

extends Object
implements MonetaryCurrenciesSingletonSpi
Class Inheritance
All Implemented Interfaces
javax.money.spi.MonetaryCurrenciesSingletonSpi
Imports
javax.money.CurrencyQuery, .CurrencyQueryBuilder, .CurrencyUnit, javax.money.spi.Bootstrap, .CurrencyProviderSpi, .MonetaryCurrenciesSingletonSpi, java.util.ArrayList, .HashSet, .List, .Locale, .Set, java.util.logging.Level, .Logger

Factory singleton for javax.money.CurrencyUnit instances as provided by the different registered javax.money.spi.CurrencyProviderSpi instances.

This class is thread safe.

Author
Anatole Tresch

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private List<CurrencyProviderSpi>
public Set<CurrencyUnit>
getCurrencies(CurrencyQuery query)

Implements javax.money.spi.MonetaryCurrenciesSingletonSpi.getCurrencies.

Access all currencies matching the given query.

public List<String>

Returns:

the default provider chain, never null.
getDefaultProviderChain
()

Implements javax.money.spi.MonetaryCurrenciesSingletonSpi.getDefaultProviderChain.

This default implementation simply returns all providers defined in arbitrary order.

private CurrencyProviderSpi
getProvider(String providerName)

public Set<String>

Returns:

the names of the currently loaded providers, never null.
getProviderNames
()

Implements javax.money.spi.MonetaryCurrenciesSingletonSpi.getProviderNames.

Get the names of the currently loaded providers.

public boolean
public boolean
isCurrencyAvailable(Locale locale, String... providers)

Overrides default javax.money.spi.MonetaryCurrenciesSingletonSpi.isCurrencyAvailable.

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

private boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultMonetaryCurrenciesSingletonSpiback to summary
public DefaultMonetaryCurrenciesSingletonSpi()

Method Detail

collectProvidersback to summary
private List<CurrencyProviderSpi> collectProviders(CurrencyQuery query)
getCurrenciesback to summary
public Set<CurrencyUnit> getCurrencies(CurrencyQuery query)

Implements javax.money.spi.MonetaryCurrenciesSingletonSpi.getCurrencies.

Doc from javax.money.spi.MonetaryCurrenciesSingletonSpi.getCurrencies.

Access all currencies matching the given query.

Annotations
@Override
getDefaultProviderChainback to summary
public List<String> getDefaultProviderChain()

Implements javax.money.spi.MonetaryCurrenciesSingletonSpi.getDefaultProviderChain.

This default implementation simply returns all providers defined in arbitrary order.

Returns:List<String>

the default provider chain, never null.

Annotations
@Override
getProviderback to summary
private CurrencyProviderSpi getProvider(String providerName)
getProviderNamesback to summary
public Set<String> getProviderNames()

Implements javax.money.spi.MonetaryCurrenciesSingletonSpi.getProviderNames.

Get the names of the currently loaded providers.

Returns:Set<String>

the names of the currently loaded providers, never null.

Annotations
@Override
isCurrencyAvailableback to summary
public boolean isCurrencyAvailable(String code, String... providers)

Overrides default javax.money.spi.MonetaryCurrenciesSingletonSpi.isCurrencyAvailable.

Doc from javax.money.spi.MonetaryCurrenciesSingletonSpi.isCurrencyAvailable.

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

Annotations
@Override
isCurrencyAvailableback to summary
public boolean isCurrencyAvailable(Locale locale, String... providers)

Overrides default javax.money.spi.MonetaryCurrenciesSingletonSpi.isCurrencyAvailable.

Doc from javax.money.spi.MonetaryCurrenciesSingletonSpi.isCurrencyAvailable.

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

Annotations
@Override
isCurrencyAvailableback to summary
private boolean isCurrencyAvailable(CurrencyQuery query)