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.
Returns:
the name of the given country code for the specified locale, or null if it's not
available.
Parameters:
-
countryCode - the ISO 3166 country code string in the form of two
upper-case letters between 'A' (U+0041) and 'Z' (U+005A)
-
locale - the desired locale
Throws:
-
NullPointerException - if
countryCode
or
locale
is null
-
IllegalArgumentException - if
countryCode
is not in the form of
two upper-case letters, or
locale
isn't
one of the locales returned from
{@link java.util.spi.LocaleServiceProvider#getAvailableLocales()
getAvailableLocales()}.
See Also:
Locale.getDisplayCountry(java.util.Locale)
,