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.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumDetermines how the factory should be considered when querying for matching implementation types callingMonetary.getAmountFactory(javax.money.MonetaryAmountFactoryQuery). -
Method Summary
Modifier and TypeMethodDescriptionAccess aMonetaryAmountFactorygiven the required context.Get the concrete amount type created byMonetaryAmountFactoryinstances provided.Returns the defaultMonetaryContextused, when noMonetaryContextis provided.default MonetaryContextReturns the maximalMonetaryContextsupported, for requests that exceed these maximal capabilities, anArithmeticExceptionmust be thrown.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:
-
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
Returns the maximalMonetaryContextsupported, for requests that exceed these maximal capabilities, anArithmeticExceptionmust be thrown.- Returns:
- the maximal
MonetaryContextsupported, nevernull
-