public interface MonetaryAmountsSingletonSpi
SPI (core) for the backing implementation of the
Monetary singleton. It
should load and manage (including contextual behavior), if needed) the different registered
MonetaryAmountFactory instances.-
Method Summary
Modifier and TypeMethodDescriptiondefault Collection<MonetaryAmountFactory<?>> Get the currently registeredMonetaryAmountimplementation classes.<T extends MonetaryAmount>
MonetaryAmountFactory<T> getAmountFactory(Class<T> amountType) Access theMonetaryAmountFactoryfor the givenamountType.Collection<Class<? extends MonetaryAmount>> Get the currently registeredMonetaryAmountimplementation types.default MonetaryAmountFactory<?> Access the defaultMonetaryAmountFactory.Class<? extends MonetaryAmount> Access the defaultMonetaryAmountimplementation type.
-
Method Details
-
getAmountFactory
Access theMonetaryAmountFactoryfor the givenamountType.- Parameters:
amountType- theMonetaryAmountimplementation type, targeted by the factory.- Returns:
- the
MonetaryAmountFactory, ornull, if no suchMonetaryAmountFactoryis available in the current context.
-
getDefaultAmountType
Class<? extends MonetaryAmount> getDefaultAmountType()Access the defaultMonetaryAmountimplementation type.- Returns:
- a the default
MonetaryAmounttype corresponding, nevernull. - Throws:
MonetaryException- if noMonetaryAmountFactoryProviderSpiis available, or noMonetaryAmountFactoryProviderSpitargeting the configured defaultMonetaryAmounttype.- See Also:
-
getAmountTypes
Collection<Class<? extends MonetaryAmount>> getAmountTypes()Get the currently registeredMonetaryAmountimplementation types.- Returns:
- the
Setif registeredMonetaryAmountimplementations, nevernull.
-
getDefaultAmountFactory
Access the defaultMonetaryAmountFactory.- Returns:
- a the default
MonetaryAmounttype corresponding, nevernull. - Throws:
MonetaryException- if noMonetaryAmountFactoryProviderSpiis available, or noMonetaryAmountFactoryProviderSpitargeting the configured defaultMonetaryAmounttype.- See Also:
-
getAmountFactories
Get the currently registeredMonetaryAmountimplementation classes.- Returns:
- the
Setif registeredMonetaryAmountimplementations, nevernull.
-