java.util.spi.LocaleNameProvider .
| Modifier and Type | Class and Description |
|---|---|
| private static class | LocaleServiceProviderPool.
Lazy loaded set of available locales. |
| public static interface | LocaleServiceProviderPool.
An interface to get a localized object for each locale sensitive service class. |
| Modifier and Type | Field and Description |
|---|---|
| private Set | availableLocales
Available locales for this locale sensitive service. |
| private static final List | NULL_LIST
A dummy locale service provider list that indicates there is no provider available |
| private static final ConcurrentMap | poolOfPools
A Map that holds singleton instances of this class. |
| private final Class | providerClass
Provider class |
| private final ConcurrentMap | providersCache
A Map that retains Locale->provider mapping |
| pack-priv static final Class | spiClasses
Array of all Locale Sensitive SPI classes. |
| Access | Constructor and Description |
|---|---|
| private | LocaleServiceProviderPool(final Class<? extends LocaleServiceProvider>
class of the locale sensitive service c)The sole constructor. |
| Modifier and Type | Method and Description |
|---|---|
| private List | Returns: the list of locale data adapter typesthe given locale locale, boolean isObjectProvider)Returns the list of locale service provider instances that support the specified locale. |
| public static Locale[] | Returns: an array of the available locales for all the provider classesReturns an array of the available locales for all the provider classes. |
| public Locale[] | Returns: an array of the available localesReturns an array of the available locales. |
| private synchronized Set | Returns: a set of available localesReturns the union of locale sets that are available from each service provider. |
| public <P extends LocaleServiceProvider, S> S | Returns: provider's instance, or null.an object on which getObject() method
is called to obtain the provider's instance. getter,the given locale that is used as the starting one locale, Object... provider specific parameters params)Returns the provider's localized object for the specified locale. |
| public <P extends LocaleServiceProvider, S> S | Returns: provider's instance, or null.an object on which getObject() method
is called to obtain the provider's instance. getter,the given locale that is used as the starting one locale, String the key string for name providers key, Object... provider specific parameters params)Returns the provider's localized name for the specified locale. |
| public <P extends LocaleServiceProvider, S> S | Returns: provider's instance, or null.an object on which getObject() method
is called to obtain the provider's instance. getter,the given locale that is used as the starting one locale, Boolean flag designating object provider or not isObjectProvider, String the key string for name providers key, Object... provider specific parameters params)Returns the provider's localized name for the specified locale. |
| private <P extends LocaleServiceProvider, S> S | getLocalizedObjectImpl(LocaleServiceProviderPool.
|
| pack-priv static Locale | Returns: the locale used for service look upthe locale locale)Returns an instance of Locale used for service look up. |
| pack-priv static List | Returns: the list of candidate locales for the given localethe input locale locale)Returns a list of candidate locales for service look up. |
| public static LocaleServiceProviderPool | getPool(Class<? extends LocaleServiceProvider> providerClass)
A factory method that returns a singleton instance |
| public static Stream | Returns: a stream of the available locales for all the provider classesReturns a stream of the available locales for all the provider classes. |
| availableLocales | back to summary |
|---|---|
| private Set<Locale> availableLocales Available locales for this locale sensitive service. This also contains JRE's available locales | |
| NULL_LIST | back to summary |
|---|---|
| private static final List<LocaleServiceProvider> NULL_LIST A dummy locale service provider list that indicates there is no provider available | |
| poolOfPools | back to summary |
|---|---|
| private static final ConcurrentMap<Class<? extends LocaleServiceProvider>, LocaleServiceProviderPool> poolOfPools A Map that holds singleton instances of this class. Each instance holds a set of provider implementations of a particular locale sensitive service. | |
| providerClass | back to summary |
|---|---|
| private final Class<? extends LocaleServiceProvider> providerClass Provider class | |
| providersCache | back to summary |
|---|---|
| private final ConcurrentMap<Locale, List<LocaleServiceProvider>> providersCache A Map that retains Locale->provider mapping | |
| spiClasses | back to summary |
|---|---|
| pack-priv static final Class<LocaleServiceProvider>[] spiClasses Array of all Locale Sensitive SPI classes. We know "spiClasses" contains classes that extends LocaleServiceProvider, but generic array creation is not allowed, thus the "unchecked" warning is suppressed here.
| |
| LocaleServiceProviderPool | back to summary |
|---|---|
| private LocaleServiceProviderPool(final Class<? extends LocaleServiceProvider> c) The sole constructor.
| |
| findProviders | back to summary |
|---|---|
| private List Returns the list of locale service provider instances that support the specified locale.
| |
| getAllAvailableLocales | back to summary |
|---|---|
| public static Locale[] getAllAvailableLocales() Returns an array of the available locales for all the provider classes. This array is a merged array of all the locales that are provided by each provider, including the JRE.
| |
| getAvailableLocales | back to summary |
|---|---|
| public Locale[] getAvailableLocales() Returns an array of the available locales. This array is a merged array of all the locales that are provided by each provider, including the JRE.
| |
| getAvailableLocaleSet | back to summary |
|---|---|
| private synchronized Set Returns the union of locale sets that are available from each service provider. This method does NOT return the defensive copy. | |
| getLocalizedObject | back to summary |
|---|---|
| public <P extends LocaleServiceProvider, S> S getLocalizedObject(LocaleServiceProviderPool. Returns the provider's localized object for the specified locale.
| |
| getLocalizedObject | back to summary |
|---|---|
| public <P extends LocaleServiceProvider, S> S getLocalizedObject(LocaleServiceProviderPool. Returns the provider's localized name for the specified locale.
| |
| getLocalizedObject | back to summary |
|---|---|
| public <P extends LocaleServiceProvider, S> S getLocalizedObject(LocaleServiceProviderPool. Returns the provider's localized name for the specified locale.
| |
| getLocalizedObjectImpl | back to summary |
|---|---|
private <P extends LocaleServiceProvider, S> S getLocalizedObjectImpl(LocaleServiceProviderPool.
| |
| getLookupLocale | back to summary |
|---|---|
| pack-priv static Locale getLookupLocale(Locale locale) Returns an instance of Locale used for service look up. The result Locale has no extensions except for ja_JP_JP and th_TH_TH | |
| getLookupLocales | back to summary |
|---|---|
| pack-priv static List Returns a list of candidate locales for service look up. | |
| getPool | back to summary |
|---|---|
| public static LocaleServiceProviderPool getPool(Class<? extends LocaleServiceProvider> providerClass) A factory method that returns a singleton instance | |
| streamAllAvailableLocales | back to summary |
|---|---|
| public static Stream Returns a stream of the available locales for all the provider classes. This stream is constructed from all the locales that are provided by each provider, including the JRE. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final Locale[] | allAvailableLocales
Available locales for all locale sensitive services. |
| Access | Constructor and Description |
|---|---|
| private |
| allAvailableLocales | back to summary |
|---|---|
| pack-priv static final Locale[] allAvailableLocales Available locales for all locale sensitive services. This also contains JRE's available locales | |
| AllAvailableLocales | back to summary |
|---|---|
| private AllAvailableLocales() | |
| Modifier and Type | Method and Description |
|---|---|
| public S |
| getObject | back to summary |
|---|---|
| public S getObject(P lsp, Locale locale, String key, Object... params) Returns an object from the provider | |