public final class

LocaleServiceProviderPool

extends Object
java.lang.Object
   ↳ sun.util.LocaleServiceProviderPool

Class Overview

An instance of this class holds a set of the third party implementations of a particular locale sensitive service, such as LocaleNameProvider.

Summary

Nested Classes
interface LocaleServiceProviderPool.LocalizedObjectGetter<P, S> An interface to get a localized object for each locale sensitve service class. 
Public Methods
static Locale[] getAllAvailableLocales()
Returns an array of available locales for all the provider classes.
synchronized Locale[] getAvailableLocales()
Returns an array of available locales.
<P, S> S getLocalizedObject(LocalizedObjectGetter<P, S> getter, Locale locale, Object... params)
Returns the provider's localized object for the specified locale.
<P, S> S getLocalizedObject(LocalizedObjectGetter<P, S> getter, Locale locale, String bundleKey, OpenListResourceBundle bundle, String key, Object... params)
Returns the provider's localized name for the specified locale.
<P, S> S getLocalizedObject(LocalizedObjectGetter<P, S> getter, Locale locale, OpenListResourceBundle bundle, String key, Object... params)
Returns the provider's localized name for the specified locale.
static LocaleServiceProviderPool getPool(Class<? extends LocaleServiceProvider> providerClass)
A factory method that returns a singleton instance
boolean hasProviders()
Returns whether any provider for this locale sensitive service is available or not.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Locale[] getAllAvailableLocales ()

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

public synchronized Locale[] getAvailableLocales ()

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

public S getLocalizedObject (LocalizedObjectGetter<P, S> getter, Locale locale, Object... params)

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 one
params provider specific parameters
Returns
  • provider's instance, or null.

public S getLocalizedObject (LocalizedObjectGetter<P, S> getter, Locale locale, String bundleKey, OpenListResourceBundle bundle, String key, Object... params)

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 one
bundleKey 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.

public S getLocalizedObject (LocalizedObjectGetter<P, S> getter, Locale locale, OpenListResourceBundle bundle, String key, Object... params)

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 one
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.

public static LocaleServiceProviderPool getPool (Class<? extends LocaleServiceProvider> providerClass)

A factory method that returns a singleton instance

public boolean hasProviders ()

Returns whether any provider for this locale sensitive service is available or not.

Returns
  • true if any provider is available