Module java.money

Class MonetaryFormats


  • public final class MonetaryFormats
    extends java.lang.Object
    This class models the singleton accessor for MonetaryAmountFormat instances.

    This class is thread-safe.

    Author:
    Anatole Tresch, Werner Keil
    • Method Detail

      • isAvailable

        public static boolean isAvailable​(java.util.Locale locale,
                                          java.lang.String... providers)
        Checks if a MonetaryAmountFormat is available for the given Locale and providers.
        Parameters:
        locale - the target Locale, not null.
        providers - The providers to be queried, if not set the providers as defined by #getDefaultCurrencyProviderChain() are queried.
        Returns:
        true, if a corresponding MonetaryAmountFormat is accessible.
      • getAvailableLocales

        public static java.util.Set<java.util.Locale> getAvailableLocales​(java.lang.String... providers)
        Get all available locales. This equals to MonetaryAmountFormatProviderSpi.getAvailableLocales().
        Parameters:
        providers - The providers to be used, if not set the providers as defined by #getDefaultCurrencyProviderChain() are used.
        Returns:
        all available locales, never null.
      • getFormatProviderNames

        public static java.util.Collection<java.lang.String> getFormatProviderNames()
        Get the names of the currently registered format providers.
        Returns:
        the provider names, never null.
      • getDefaultFormatProviderChain

        public static java.util.List<java.lang.String> getDefaultFormatProviderChain()
        Get the default provider chain, identified by the unique provider names in order as evaluated and used.
        Returns:
        the default provider chain, never null.