Package net.sourceforge.jnlp.util
Class LocaleUtils
- java.lang.Object
-
- net.sourceforge.jnlp.util.LocaleUtils
-
public class LocaleUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classLocaleUtils.Match
-
Constructor Summary
Constructors Constructor Description LocaleUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.LocalegetLocale(java.lang.String localeString)Returns aLocalefrom a locale string.static booleanlocaleMatches(java.util.Locale[] availableLocales, java.util.Locale locale)(package private) static booleanlocalMatches(java.util.Locale requested, LocaleUtils.Match matchLevel, java.util.Locale... available)Returns whether a locale is matched by one of more other locales.
-
-
-
Method Detail
-
getLocale
public static java.util.Locale getLocale(java.lang.String localeString) throws ParseExceptionReturns aLocalefrom a locale string. Each locale is specified by a language identifier, possibly country identifier, and possibly a variant. The syntax is as follows:locale ::= language [ "_" country [ "_" variant ] ]
- Parameters:
localeString- the locale string- Returns:
- locale of document
- Throws:
ParseException
-
localeMatches
public static boolean localeMatches(java.util.Locale[] availableLocales, java.util.Locale locale)
-
localMatches
static boolean localMatches(java.util.Locale requested, LocaleUtils.Match matchLevel, java.util.Locale... available)Returns whether a locale is matched by one of more other locales. Only the non-empty language, country, and variant codes are compared; for example, a requested locale of Locale("","","") would always return true.- Parameters:
requested- the requested localematchLevel- the depth with which to match locales.available- the available locales- Returns:
trueifrequestedmatches any ofavailable, or ifavailableis empty ornull.- See Also:
Locale,LocaleUtils.Match
-
-