public class DefaultMonetaryAmountsSpi extends java.lang.Object implements MonetaryAmountsSpi
| Constructor and Description |
|---|
DefaultMonetaryAmountsSpi() |
| Modifier and Type | Method and Description |
|---|---|
<T extends MonetaryAmount> |
getAmountFactory(java.lang.Class<T> amountType)
Access the
MonetaryAmountFactory for the given amountType . |
java.util.Set<java.lang.Class<? extends MonetaryAmount>> |
getAmountTypes()
Get the currently registered
MonetaryAmount implementation types. |
java.lang.Class<? extends MonetaryAmount> |
getDefaultAmountType()
Access the default
MonetaryAmount type. |
java.lang.Class<? extends MonetaryAmount> |
queryAmountType(MonetaryContext requiredContext)
Get the
MonetaryAmount implementation class, that best matches to cover the given
MonetaryContext. |
public <T extends MonetaryAmount> MonetaryAmountFactory<T> getAmountFactory(java.lang.Class<T> amountType)
MonetaryAmountsSpiMonetaryAmountFactory for the given amountType .getAmountFactory in interface MonetaryAmountsSpiamountType - the MonetaryAmount implementation type, targeted by the factory.MonetaryAmountFactory, or null, if no such
MonetaryAmountFactory is available in the current context.public java.util.Set<java.lang.Class<? extends MonetaryAmount>> getAmountTypes()
MonetaryAmountsSpiMonetaryAmount implementation types.getAmountTypes in interface MonetaryAmountsSpiSet if registered MonetaryAmount implementation types, never
null.public java.lang.Class<? extends MonetaryAmount> queryAmountType(MonetaryContext requiredContext)
MonetaryAmountsSpiMonetaryAmount implementation class, that best matches to cover the given
MonetaryContext.
The evaluation order should consider the following aspects:
MonetaryContext.getAmountType() is defined, it should be considered.
Nevertheless if precision/scale cannot be met, a MonetaryException should
be thrown.
precision==0 (unlimited precision), the
MonetaryAmount implementation candidate should be chosen with highest possible
precision.
Flavor.PERFORMANCE are preferred.
queryAmountType in interface MonetaryAmountsSpirequiredContext - the required MonetaryContextMonetaryAmount implementation class, that best matches to cover the given
MonetaryContext, never null.public java.lang.Class<? extends MonetaryAmount> getDefaultAmountType()
MonetaryAmountsSpiMonetaryAmount type.getDefaultAmountType in interface MonetaryAmountsSpiMonetaryAmount type corresponding, never null.MonetaryAmounts.getDefaultAmountType()