- All Known Implementing Classes:
MonetaryFormats.DefaultMonetaryFormatsSingletonSpi
public interface MonetaryFormatsSingletonSpi
This interface models the singleton functionality of
MonetaryFormats.
Implementations of this interface must be thread-safe.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MonetaryAmountFormatgetAmountFormat(String formatName, String... providers) Access the defaultMonetaryAmountFormatgiven aLocale.default MonetaryAmountFormatgetAmountFormat(Locale locale, String... providers) Access the defaultMonetaryAmountFormatgiven aLocale.default MonetaryAmountFormatgetAmountFormat(AmountFormatQuery formatQuery) Access anMonetaryAmountFormatgiven a.AmountFormatQuery.getAmountFormats(AmountFormatQuery formatQuery) Access allMonetaryAmountFormatinstances matching the given.AmountFormatQuery.getAvailableLocales(String... providers) Get all available locales.Get the default provider chain, identified by the unique provider names in order as evaluated and used.Get the names of the currently registered format providers.default booleanisAvailable(Locale locale, String... providers) Checks if aMonetaryAmountFormatis available given a.AmountFormatQuery.default booleanisAvailable(AmountFormatQuery formatQuery) Checks if aMonetaryAmountFormatis available given a.AmountFormatQuery.
-
Method Details
-
getAvailableLocales
Get all available locales. This equals toMonetaryAmountFormatProviderSpi.getAvailableLocales().- Parameters:
providers- The (optional) providers to be used, ordered correspondingly.- Returns:
- all available locales, never
null.
-
getAmountFormats
Access allMonetaryAmountFormatinstances matching the given.AmountFormatQuery.- Parameters:
formatQuery- The format query defining the requirements of the formatter.- Returns:
- the corresponding
MonetaryAmountFormatinstances, never null
-
getProviderNames
Get the names of the currently registered format providers.- Returns:
- the provider names, never null.
-
getDefaultProviderChain
Get the default provider chain, identified by the unique provider names in order as evaluated and used.- Returns:
- the default provider chain, never null.
-
getAmountFormat
Access anMonetaryAmountFormatgiven a.AmountFormatQuery.- Parameters:
formatQuery- The format query defining the requirements of the formatter.- Returns:
- the corresponding
MonetaryAmountFormat - Throws:
MonetaryException- if no registered.MonetaryAmountFormatProviderSpican provide a correspondingMonetaryAmountFormatinstance.
-
isAvailable
Checks if aMonetaryAmountFormatis available given a.AmountFormatQuery.- Parameters:
formatQuery- The format query defining the requirements of the formatter.- Returns:
- true, if a t least one
MonetaryAmountFormatis matching the query.
-
isAvailable
Checks if aMonetaryAmountFormatis available given a.AmountFormatQuery.- Parameters:
locale- the targetLocale, notnull.providers- The (optional) providers to be used, ordered correspondingly.- Returns:
- true, if a t least one
MonetaryAmountFormatis matching the query.
-
getAmountFormat
Access the defaultMonetaryAmountFormatgiven aLocale.- Parameters:
locale- the targetLocale, notnull.providers- The (optional) providers to be used, ordered correspondingly.- Returns:
- the matching
MonetaryAmountFormat - Throws:
MonetaryException- if no registeredMonetaryAmountFormatProviderSpican provide a correspondingMonetaryAmountFormatinstance.
-
getAmountFormat
Access the defaultMonetaryAmountFormatgiven aLocale.- Parameters:
formatName- the target format name, notnull.providers- The (optional) providers to be used, ordered correspondingly.- Returns:
- the matching
MonetaryAmountFormat - Throws:
MonetaryException- if no registeredMonetaryAmountFormatProviderSpican provide a correspondingMonetaryAmountFormatinstance.
-