public final class MonetaryFormats extends Object
MonetaryAmountFormat
instances.
This class is thread-safe.
Modifier and Type | Class and Description |
---|---|
static class |
MonetaryFormats.DefaultMonetaryFormatsSingletonSpi
This class models the singleton accessor for
MonetaryAmountFormat instances. |
Modifier and Type | Method and Description |
---|---|
static MonetaryAmountFormat |
getAmountFormat(AmountFormatQuery formatQuery)
Access the default
MonetaryAmountFormat given a Locale . |
static MonetaryAmountFormat |
getAmountFormat(Locale locale,
String... providers)
Access the default
MonetaryAmountFormat given a Locale . |
static MonetaryAmountFormat |
getAmountFormat(String formatName,
String... providers)
Access the a
MonetaryAmountFormat given its styleId. |
static Collection<MonetaryAmountFormat> |
getAmountFormats(AmountFormatQuery formatQuery)
Access all
MonetaryAmountFormat instances that match the given a AmountFormatQuery . |
static Set<Locale> |
getAvailableLocales(String... providers)
Get all available locales.
|
static List<String> |
getDefaultFormatProviderChain()
Get the default provider chain, identified by the unique provider names in order as evaluated and used.
|
static Collection<String> |
getFormatProviderNames()
Get the names of the currently registered format providers.
|
static boolean |
isAvailable(AmountFormatQuery formatQuery)
Checks if a
MonetaryAmountFormat is available for the given AmountFormatQuery . |
static boolean |
isAvailable(Locale locale,
String... providers)
Checks if a
MonetaryAmountFormat is available for the given Locale and providers. |
public static boolean isAvailable(Locale locale, String... providers)
MonetaryAmountFormat
is available for the given Locale
and providers.locale
- the target Locale
, not null
.providers
- The providers to be queried, if not set the providers as defined by #getDefaultCurrencyProviderChain()
are queried.MonetaryAmountFormat
is accessible.public static MonetaryAmountFormat getAmountFormat(Locale locale, String... providers)
MonetaryAmountFormat
given a Locale
.locale
- the target Locale
, not null
.providers
- The providers to be queried, if not set the providers as defined by #getDefaultCurrencyProviderChain()
are queried.MonetaryAmountFormat
MonetaryException
- if no registered MonetaryAmountFormatProviderSpi
can provide a
corresponding MonetaryAmountFormat
instance.public static boolean isAvailable(AmountFormatQuery formatQuery)
MonetaryAmountFormat
is available for the given AmountFormatQuery
.formatQuery
- the required AmountFormatQuery
, not null
. If the query does not define
any explicit provider chain, the providers as defined by #getDefaultCurrencyProviderChain()
are used.MonetaryAmountFormat
is accessible.public static MonetaryAmountFormat getAmountFormat(AmountFormatQuery formatQuery)
MonetaryAmountFormat
given a Locale
.formatQuery
- the required AmountFormatQuery
, not null
. If the query does not define
any explicit provider chain, the providers as defined by #getDefaultCurrencyProviderChain()
are used.MonetaryAmountFormat
MonetaryException
- if no registered MonetaryAmountFormatProviderSpi
can provide a
corresponding MonetaryAmountFormat
instance.public static Collection<MonetaryAmountFormat> getAmountFormats(AmountFormatQuery formatQuery)
MonetaryAmountFormat
instances that match the given a AmountFormatQuery
.formatQuery
- the required AmountFormatQuery
, not null
. If the query does not define
any explicit provider chain, the providers as defined by #getDefaultCurrencyProviderChain()
are used.MonetaryAmountFormat
MonetaryException
- if no registered MonetaryAmountFormatProviderSpi
can provide a
corresponding MonetaryAmountFormat
instance.public static MonetaryAmountFormat getAmountFormat(String formatName, String... providers)
MonetaryAmountFormat
given its styleId.formatName
- the target format name, not null
.providers
- The providers to be used, if not set the providers as defined by #getDefaultCurrencyProviderChain() are
used.MonetaryAmountFormat
MonetaryException
- if no registered MonetaryAmountFormatProviderSpi
can provide a
corresponding MonetaryAmountFormat
instance.public static Set<Locale> getAvailableLocales(String... providers)
MonetaryAmountFormatProviderSpi.getAvailableLocales()
.providers
- The providers to be used, if not set the providers as defined by #getDefaultCurrencyProviderChain() are
used.null
.public static Collection<String> getFormatProviderNames()
Copyright © 2012–2016 JSR 354 - Expert Group. All rights reserved.