Class LocaleUtil

java.lang.Object
org.apache.uima.fit.util.LocaleUtil

public final class LocaleUtil extends Object
  • Method Details

    • getLocaleConstant

      public static Locale getLocaleConstant(String localeConstant)
      This method returns the locale constant for the given string. For example, see Locale.US as an example locale constant. To retrieve that locale using this method, pass in the string value "US". If there is no locale constant for the passed in string, then null is returned
      Parameters:
      localeConstant - a string value that names a locale constant.
      Returns:
      the corresponding locale or null if there is no locale for the provided string.
    • createLocale

      public static Locale createLocale(String localeString)
      This method passes through to Locale(String) unless the provided string contains a hyphen. If it does, then the string is split on the hyphen and the resulting strings are passed into the multi-parameter constructors of Locale. The passed in string should not contain more than two hyphens as the Locale constructor with the most params is three.
      Parameters:
      localeString - the locale string
      Returns:
      the parsed locale
    • getLocale

      public static Locale getLocale(String localeString)
      passes through to getLocaleConstant. If this returns null, then this method passes through to createLocale.
      Parameters:
      localeString - the locale string
      Returns:
      the parsed locale