org.xwiki.localization
Class LocaleUtils

java.lang.Object
  extended by org.apache.commons.lang3.LocaleUtils
      extended by org.xwiki.localization.LocaleUtils

public class LocaleUtils
extends org.apache.commons.lang3.LocaleUtils

Extends LocaleUtils with more tools.

Since:
5.1RC1
Version:
$Id: 3e311bc364f0ac98dfcfc4705c3b20887bb5906d $

Constructor Summary
LocaleUtils()
           
 
Method Summary
static Locale getParentLocale(Locale locale)
           
static Locale toLocale(String str)
          Extends LocaleUtils which return Locale.ROOT for an empty string.
 
Methods inherited from class org.apache.commons.lang3.LocaleUtils
availableLocaleList, availableLocaleSet, countriesByLanguage, isAvailableLocale, languagesByCountry, localeLookupList, localeLookupList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleUtils

public LocaleUtils()
Method Detail

getParentLocale

public static Locale getParentLocale(Locale locale)
Parameters:
locale - the locale
Returns:
the parent locale

toLocale

public static Locale toLocale(String str)
Extends LocaleUtils which return Locale.ROOT for an empty string.

Parameters:
str - the locale String to convert, null returns null
Returns:
a Locale, null if null input
Throws:
IllegalArgumentException - if the string is an invalid format
Since:
5.2M1


Copyright © 2004–2014 XWiki. All rights reserved.