Class LocaleUtils

java.lang.Object
net.sourceforge.jnlp.util.LocaleUtils

public class LocaleUtils extends Object
  • Constructor Details

    • LocaleUtils

      public LocaleUtils()
  • Method Details

    • getLocale

      public static Locale getLocale(String localeString) throws ParseException
      Returns a Locale from 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(Locale[] availableLocales, Locale locale)
    • localMatches

      static boolean localMatches(Locale requested, LocaleUtils.Match matchLevel, 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 locale
      matchLevel - the depth with which to match locales.
      available - the available locales
      Returns:
      true if requested matches any of available, or if available is empty or null.
      See Also: