org.apache.uima.fit.util

## Class LocaleUtil

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

-     public final class LocaleUtil
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Locale` | `createLocale(String localeString)` This method passes through to `Locale.Locale(String)` unless the provided string contains a hyphen.
    `static Locale` | `getLocale(String localeString)` passes through to getLocaleConstant.
    `static Locale` | `getLocaleConstant(String localeConstant)` This method returns the locale constant for the given string.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### 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.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

Copyright © 2012–2020 The Apache Software Foundation. All rights reserved.