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 classMonetaryAmountFactoryProviderSpi.QueryInclusionPolicyDetermines 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 aMonetaryAmountFactorygiven the required context.java.lang.Class<T>getAmountType()Get the concrete amount type created byMonetaryAmountFactoryinstances provided.MonetaryContextgetDefaultMonetaryContext()Returns the defaultMonetaryContextused, when noMonetaryContextis provided.default MonetaryContextgetMaximalMonetaryContext()Returns the maximalMonetaryContextsupported, for requests that exceed these maximal capabilities, anArithmeticExceptionmust be thrown.default MonetaryAmountFactoryProviderSpi.QueryInclusionPolicygetQueryInclusionPolicy()Method that determines if this factory should be considered for general evaluation of matchingMonetaryAmountimplementation types when callingMonetary.getAmountFactory(javax.money.MonetaryAmountFactoryQuery).
-
Method Details
-
getQueryInclusionPolicy
Method that determines if this factory should be considered for general evaluation of matchingMonetaryAmountimplementation types when callingMonetary.getAmountFactory(javax.money.MonetaryAmountFactoryQuery).- Returns:
trueto 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 byMonetaryAmountFactoryinstances provided.- Returns:
- the concrete amount type created, never null.
-
createMonetaryAmountFactory
MonetaryAmountFactory<T> createMonetaryAmountFactory()Access aMonetaryAmountFactorygiven the required context.- Returns:
- the corresponding
MonetaryAmountFactory, ornull.
-
getDefaultMonetaryContext
MonetaryContext getDefaultMonetaryContext()Returns the defaultMonetaryContextused, when noMonetaryContextis provided.The default context is not allowed to exceed the capabilities of the maximal
MonetaryContextsupported.- Returns:
- the default
MonetaryContext, nevernull. - See Also:
getMaximalMonetaryContext()
-
getMaximalMonetaryContext
Returns the maximalMonetaryContextsupported, for requests that exceed these maximal capabilities, anArithmeticExceptionmust be thrown.- Returns:
- the maximal
MonetaryContextsupported, nevernull
-