A Map that holds singleton instances of this class. Each instance holds a
set of provider implementations of a particular locale sensitive service.
A Set containing locale service providers that implement the
specified provider SPI
A Map that retains Locale->provider mapping
Available locales for this locale sensitive service. This also contains
JRE's available locales
Available locales within this JRE. Currently this is declared as
static. This could be non-static later, so that they could have
different sets for each locale sensitive services.
Provider locales for this locale sensitive service.
A factory method that returns a singleton instance
The sole constructor.
- Parameters:
c class of the locale sensitive service
Lazy loaded set of available locales.
Loading all locales is a very long operation.
Available locales for all locale sensitive services.
This also contains JRE's available locales
Class[] providerClasses = { for (Class providerClass : providerClasses) { LocaleServiceProviderPool.getPool(providerClass);
Returns an array of 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.
- Returns:
- an array of the available locales for all provider classes
Returns an array of available locales. This array is a
merged array of all the locales that are provided by each
provider, including the JRE.
- Returns:
- an array of the available locales
Returns an array of available locales from providers.
Note that this method does not return a defensive copy.
- Returns:
- list of the provider locales
for (Locale locale: locales) { Returns whether any provider for this locale sensitive
service is available or not.
- Returns:
- true if any provider is available
Returns an array of available locales supported by the JRE.
Note that this method does not return a defensive copy.
- Returns:
- list of the available JRE locales
Returns whether the given locale is supported by the JRE.
- Parameters:
locale the locale to test.- Returns:
- true, if the locale is supported by the JRE. false
otherwise.
Returns the provider's localized object for the specified
locale.
- Parameters:
getter an object on which getObject() method
is called to obtain the provider's instance.locale the given locale that is used as the starting oneparams provider specific parameters- Returns:
- provider's instance, or null.
Returns the provider's localized name for the specified
locale.
- Parameters:
getter an object on which getObject() method
is called to obtain the provider's instance.locale the given locale that is used as the starting onebundle JRE resource bundle that contains
the localized names, or null for localized objects.key the key string if bundle is supplied, otherwise null.params provider specific parameters- Returns:
- provider's instance, or null.
Returns the provider's localized name for the specified
locale.
- Parameters:
getter an object on which getObject() method
is called to obtain the provider's instance.locale the given locale that is used as the starting onebundleKey JRE specific bundle key. e.g., "USD" is for currency
symbol and "usd" is for currency display name in the JRE bundle.bundle JRE resource bundle that contains
the localized names, or null for localized objects.key the key string if bundle is supplied, otherwise null.params provider specific parameters- Returns:
- provider's instance, or null.
boolean isObjectProvider,
providersObj = getter.getObject(lsp, requested, key, params);
if (providersObj != null) { } else if (isObjectProvider) { "A locale sensitive service provider returned null for a localized objects, which should not happen. provider: " + lsp + " locale: " + requested);
providersObj = getter.getObject(lsp, requested, key, params);
if (providersObj != null) { Returns a locale service provider instance that supports
the specified locale.
- Parameters:
locale the given locale- Returns:
- the provider, or null if there is
no provider available.
for (Locale available: locales) { if (locale.equals(available)) { return (providerInCache != null ?
Returns the provider's locale that is the most appropriate
within the range
- Parameters:
start the given locale that is used as the starting oneend the given locale that is used as the end one (exclusive),
or null if it reaching any of the JRE supported locale should
terminate the look up.- Returns:
- the most specific locale within the range, or null
if no provider locale found in that range.
while (current != null) { Returns the parent locale.
- Parameters:
locale the locale- Returns:
- the parent locale
if (underscoreIndex != (-1)) { A dummy locale service provider that indicates there is no
provider available
An interface to get a localized object for each locale sensitve
service class.
Returns an object from the provider
- Parameters:
lsp the providerlocale the localekey key string to localize, or null if the provider is not
a name providerparams provider specific params- Returns:
- localized object from the provider