Package java.util.spi
Class LocaleNameProvider
java.lang.Object
java.util.spi.LocaleServiceProvider
java.util.spi.LocaleNameProvider
public abstract class LocaleNameProvider extends LocaleServiceProvider
This abstract class should be extended by service providers that provide
localized locale names.
Note that Android does not support user-supplied locale service providers.
- Since:
- 1.6
-
Constructor Summary
Constructors Modifier Constructor Description protectedLocaleNameProvider()Default constructor, for use by subclasses. -
Method Summary
Modifier and Type Method Description abstract StringgetDisplayCountry(String countryCode, Locale locale)Returns the localized name for the given ISO 3166 country code.abstract StringgetDisplayLanguage(String languageCode, Locale locale)Returns the localized name for the given ISO 639 language code.abstract StringgetDisplayVariant(String variantCode, Locale locale)Returns the localized name for the given variant code.Methods inherited from class java.util.spi.LocaleServiceProvider
getAvailableLocales
-
Constructor Details
-
LocaleNameProvider
protected LocaleNameProvider()Default constructor, for use by subclasses.
-
-
Method Details
-
getDisplayLanguage
Returns the localized name for the given ISO 639 language code.- Parameters:
languageCode- an ISO 639 language codelocale- a locale- Returns:
- the name or null if unavailable
- Throws:
NullPointerException- ifcode == null || locale == nullIllegalArgumentException- if code or locale is not in a legal format or not available
-
getDisplayCountry
Returns the localized name for the given ISO 3166 country code.- Parameters:
countryCode- an ISO 3166 language codelocale- a locale- Returns:
- the name or null if unavailable
- Throws:
NullPointerException- ifcode == null || locale == nullIllegalArgumentException- if code or locale is not in a legal format or not available
-
getDisplayVariant
Returns the localized name for the given variant code.- Parameters:
variantCode- a variant codelocale- a locale- Returns:
- the name or null if unavailable
- Throws:
NullPointerException- ifcode == null || locale == nullIllegalArgumentException- if code or locale is not in a legal format or not available
-