Top Description Methods
javax.money.spi

public Interface MonetaryAmountsSingletonSpi

Imports
javax.money.MonetaryAmount, .MonetaryAmountFactory, .MonetaryException, java.util.ArrayList, .Collection, .List, .Set

SPI (core) for the backing implementation of the javax.money.Monetary singleton. It should load and manage (including contextual behavior), if needed) the different registered javax.money.MonetaryAmountFactory instances.
Author
Anatole Tresch

Method Summary

Modifier and TypeMethod and Description
public default Collection<MonetaryAmountFactory<?>>

Returns:

the Set if registered MonetaryAmount implementations, never null.
getAmountFactories
()

Get the currently registered MonetaryAmount implementation classes.

public <T extends MonetaryAmount> MonetaryAmountFactory<T>

Returns:

the javax.money.MonetaryAmountFactory, or null, if no such javax.money.MonetaryAmountFactory is available in the current context.
getAmountFactory
(Class<T>
the MonetaryAmount implementation type, targeted by the factory.
amountType
)

Access the javax.money.MonetaryAmountFactory for the given amountType .

public Collection<Class<? extends MonetaryAmount>>

Returns:

the Set if registered MonetaryAmount implementations, never null.
getAmountTypes
()

Get the currently registered MonetaryAmount implementation types.

public default MonetaryAmountFactory<?>

Returns:

a the default MonetaryAmount type corresponding, never null.
getDefaultAmountFactory
()

Access the default javax.money.MonetaryAmountFactory.

public Class<? extends MonetaryAmount>

Returns:

a the default MonetaryAmount type corresponding, never null.
getDefaultAmountType
()

Access the default MonetaryAmount implementation type.

Method Detail

getAmountFactoriesback to summary
public default Collection<MonetaryAmountFactory<?>> getAmountFactories()

Get the currently registered MonetaryAmount implementation classes.

Returns:Collection<MonetaryAmountFactory<?>>

the Set if registered MonetaryAmount implementations, never null.

getAmountFactoryback to summary
public <T extends MonetaryAmount> MonetaryAmountFactory<T> getAmountFactory(Class<T> amountType)

Access the javax.money.MonetaryAmountFactory for the given amountType .

Parameters
amountType:Class<T>

the MonetaryAmount implementation type, targeted by the factory.

Returns:MonetaryAmountFactory<T>

the javax.money.MonetaryAmountFactory, or null, if no such javax.money.MonetaryAmountFactory is available in the current context.

getAmountTypesback to summary
public Collection<Class<? extends MonetaryAmount>> getAmountTypes()

Get the currently registered MonetaryAmount implementation types.

Returns:Collection<Class<? extends MonetaryAmount>>

the Set if registered MonetaryAmount implementations, never null.

getDefaultAmountFactoryback to summary
public default MonetaryAmountFactory<?> getDefaultAmountFactory()

Access the default javax.money.MonetaryAmountFactory.

Returns:MonetaryAmountFactory<?>

a the default MonetaryAmount type corresponding, never null.

Exceptions
MonetaryException:
if no MonetaryAmountFactoryProviderSpi is available, or no MonetaryAmountFactoryProviderSpi targeting the configured default MonetaryAmount type.
See Also
javax.money.Monetary#getDefaultAmountType()
getDefaultAmountTypeback to summary
public Class<? extends MonetaryAmount> getDefaultAmountType()

Access the default MonetaryAmount implementation type.

Returns:Class<? extends MonetaryAmount>

a the default MonetaryAmount type corresponding, never null.

Exceptions
MonetaryException:
if no MonetaryAmountFactoryProviderSpi is available, or no MonetaryAmountFactoryProviderSpi targeting the configured default MonetaryAmount type.
See Also
javax.money.Monetary#getDefaultAmountType()