| java.lang.Object java.util.spi.LocaleServiceProvider java.util.spi.LocaleNameProvider
LocaleNameProvider | abstract public class LocaleNameProvider extends LocaleServiceProvider (Code) | | An abstract class for service providers that
provide localized names for the
java.util.Locale Locale class.
since: 1.6 version: @(#)LocaleNameProvider.java 1.8 07/05/05 |
Method Summary | |
abstract public String | getDisplayCountry(String countryCode, Locale locale) Returns a localized name for the given ISO 3166 country code and the
given locale that is appropriate for display to the user. | abstract public String | getDisplayLanguage(String languageCode, Locale locale) Returns a localized name for the given ISO 639 language code and the
given locale that is appropriate for display to the user. | abstract public String | getDisplayVariant(String variant, Locale locale) Returns a localized name for the given variant code and the given locale that
is appropriate for display to the user. |
LocaleNameProvider | protected LocaleNameProvider()(Code) | | Sole constructor. (For invocation by subclass constructors, typically
implicit.)
|
getDisplayCountry | abstract public String getDisplayCountry(String countryCode, Locale locale)(Code) | | Returns a localized name for the given ISO 3166 country code and the
given locale that is appropriate for display to the user.
For example, if countryCode is "FR" and locale
is en_US, getDisplayCountry() will return "France"; if countryCode
is "US" and locale is fr_FR, getDisplayCountry() will return "Etats-Unis".
If the name returned cannot be localized according to locale ,
(say, the provider does not have a Japanese name for Croatia),
this method returns null.
Parameters: countryCode - the ISO 3166 country code string in the form of twoupper-case letters between 'A' (U+0041) and 'Z' (U+005A) Parameters: locale - the desired locale the name of the given country code for the specified locale, or null if it's notavailable. exception: NullPointerException - if countryCode or locale is null exception: IllegalArgumentException - if countryCode is not in the form oftwo upper-case letters, or locale isn'tone of the locales returned from java.util.spi.LocaleServiceProvider.getAvailableLocales getAvailableLocales(). See Also: java.util.Locale.getDisplayCountry(java.util.Locale) |
getDisplayLanguage | abstract public String getDisplayLanguage(String languageCode, Locale locale)(Code) | | Returns a localized name for the given ISO 639 language code and the
given locale that is appropriate for display to the user.
For example, if languageCode is "fr" and locale
is en_US, getDisplayLanguage() will return "French"; if languageCode
is "en" and locale is fr_FR, getDisplayLanguage() will return "anglais".
If the name returned cannot be localized according to locale ,
(say, the provider does not have a Japanese name for Croatian),
this method returns null.
Parameters: languageCode - the ISO 639 language code string in the form of twolower-case letters between 'a' (U+0061) and 'z' (U+007A) Parameters: locale - the desired locale the name of the given language code for the specified locale, or null if it's not available. exception: NullPointerException - if languageCode or locale is null exception: IllegalArgumentException - if languageCode is not in the form oftwo lower-case letters, or locale isn'tone of the locales returned from java.util.spi.LocaleServiceProvider.getAvailableLocales getAvailableLocales(). See Also: java.util.Locale.getDisplayLanguage(java.util.Locale) |
Methods inherited from java.util.spi.LocaleServiceProvider | abstract public Locale[] getAvailableLocales()(Code)(Java Doc)
|
|
|