|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.taglibs.standard.tag.common.fmt.LocaleUtil
public class LocaleUtil
Utility functions for working with Locales. This implementation sticks with the Locale parsing rules defined by the JSTL Specification. When permitted, this should be updated to use the richer Locale parsing rules provided in Java 7 and later.
Constructor Summary | |
---|---|
LocaleUtil()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LocaleUtil()
Method Detail |
---|
public static Locale parseLocaleAttributeValue(Object stringOrLocale)
parseLocale(String)
.
Otherwise null will be returned.
stringOrLocale
- locale represented as an instance of Locale or as a String
public 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 variant
IllegalArgumentException
- if the given locale does not have a
language component or has an empty country component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |