Module java.money
Package javax.money.spi
Interface MonetaryAmountFactoryProviderSpi<T extends MonetaryAmount>
- Type Parameters:
T
- the concrete amount type.
public interface MonetaryAmountFactoryProviderSpi<T extends MonetaryAmount>
SPI (core): Implementations of this interface are used by the
MonetaryAmountsSingletonSpi
to evaluate the
correct MonetaryAmountFactory
instances.- Author:
- Anatole Tresch
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MonetaryAmountFactoryProviderSpi.QueryInclusionPolicy
Determines how the factory should be considered when querying for matching implementation types callingMonetary.getAmountFactory(javax.money.MonetaryAmountFactoryQuery)
. -
Method Summary
Modifier and Type Method Description MonetaryAmountFactory<T>
createMonetaryAmountFactory()
Access aMonetaryAmountFactory
given the required context.java.lang.Class<T>
getAmountType()
Get the concrete amount type created byMonetaryAmountFactory
instances provided.MonetaryContext
getDefaultMonetaryContext()
Returns the defaultMonetaryContext
used, when noMonetaryContext
is provided.default MonetaryContext
getMaximalMonetaryContext()
Returns the maximalMonetaryContext
supported, for requests that exceed these maximal capabilities, anArithmeticException
must be thrown.default MonetaryAmountFactoryProviderSpi.QueryInclusionPolicy
getQueryInclusionPolicy()
Method that determines if this factory should be considered for general evaluation of matchingMonetaryAmount
implementation types when callingMonetary.getAmountFactory(javax.money.MonetaryAmountFactoryQuery)
.
-
Method Details
-
getQueryInclusionPolicy
Method that determines if this factory should be considered for general evaluation of matchingMonetaryAmount
implementation types when callingMonetary.getAmountFactory(javax.money.MonetaryAmountFactoryQuery)
.- Returns:
true
to include this factory into the evaluation.- See Also:
Monetary.getAmountFactory(javax.money.MonetaryAmountFactoryQuery)
-
getAmountType
java.lang.Class<T> getAmountType()Get the concrete amount type created byMonetaryAmountFactory
instances provided.- Returns:
- the concrete amount type created, never null.
-
createMonetaryAmountFactory
MonetaryAmountFactory<T> createMonetaryAmountFactory()Access aMonetaryAmountFactory
given the required context.- Returns:
- the corresponding
MonetaryAmountFactory
, ornull
.
-
getDefaultMonetaryContext
MonetaryContext getDefaultMonetaryContext()Returns the defaultMonetaryContext
used, when noMonetaryContext
is provided.The default context is not allowed to exceed the capabilities of the maximal
MonetaryContext
supported.- Returns:
- the default
MonetaryContext
, nevernull
. - See Also:
getMaximalMonetaryContext()
-
getMaximalMonetaryContext
Returns the maximalMonetaryContext
supported, for requests that exceed these maximal capabilities, anArithmeticException
must be thrown.- Returns:
- the maximal
MonetaryContext
supported, nevernull
-