public class LocaleUtil extends Object
Constructor and Description |
---|
LocaleUtil() |
Modifier and Type | Method and Description |
---|---|
static Locale |
parseLocale(String locale)
See parseLocale(String, String) for details.
|
static Locale |
parseLocale(String locale,
String variant)
Parses the given locale string into its language and (optionally)
country components, and returns the corresponding
Locale object. |
static Locale |
parseLocaleAttributeValue(Object stringOrLocale)
Handles Locales that can be passed to tags as instances of String or Locale.
|
public static Locale parseLocaleAttributeValue(Object stringOrLocale)
parseLocale(String)
.
Otherwise null will be returned.stringOrLocale
- locale represented as an instance of Locale or as a Stringpublic static Locale parseLocale(String locale)
public static Locale parseLocale(String locale, String variant)
Locale
object.locale
- the locale string to parse; must not be null or emptyvariant
- the variantIllegalArgumentException
- if the given locale does not have a
language component or has an empty country componentCopyright © 2017 JBoss by Red Hat. All rights reserved.