jodd.util
Class LocaleUtil

java.lang.Object
  extended by jodd.util.LocaleUtil

public class LocaleUtil
extends java.lang.Object

Locale utilities.


Field Summary
protected static java.util.Map<java.lang.String,jodd.util.LocaleUtil.LocaleData> locales
           
 
Constructor Summary
LocaleUtil()
           
 
Method Summary
static java.lang.String[] decodeLocaleCode(java.lang.String localeCode)
          Decodes locale code in string array that can be used for Locale constructor.
static DateFormatSymbolsEx getDateFormatSymbols(java.util.Locale locale)
          Returns DateFormatSymbols instance for specified locale.
static java.util.Locale getLocale(java.lang.String languageCode)
          Returns Locale from cache where Locale may be specified also using language code.
static java.util.Locale getLocale(java.lang.String language, java.lang.String country)
          Returns Locale from cache.
static java.util.Locale getLocale(java.lang.String language, java.lang.String country, java.lang.String variant)
          Returns Locale from cache.
static java.text.NumberFormat getNumberFormat(java.util.Locale locale)
          Returns NumberFormat instance for specified locale.
protected static jodd.util.LocaleUtil.LocaleData lookupLocaleData(java.util.Locale locale)
           
protected static jodd.util.LocaleUtil.LocaleData lookupLocaleData(java.lang.String code)
          Lookups for locale data and creates new if it doesn't exist.
static java.lang.String resolveLocaleCode(java.util.Locale locale)
          Resolves locale code from locale.
static java.lang.String resolveLocaleCode(java.lang.String lang, java.lang.String country, java.lang.String variant)
          Transforms locale data to locale code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locales

protected static java.util.Map<java.lang.String,jodd.util.LocaleUtil.LocaleData> locales
Constructor Detail

LocaleUtil

public LocaleUtil()
Method Detail

lookupLocaleData

protected static jodd.util.LocaleUtil.LocaleData lookupLocaleData(java.lang.String code)
Lookups for locale data and creates new if it doesn't exist.


lookupLocaleData

protected static jodd.util.LocaleUtil.LocaleData lookupLocaleData(java.util.Locale locale)

getLocale

public static java.util.Locale getLocale(java.lang.String language,
                                         java.lang.String country,
                                         java.lang.String variant)
Returns Locale from cache.


getLocale

public static java.util.Locale getLocale(java.lang.String language,
                                         java.lang.String country)
Returns Locale from cache.


getLocale

public static java.util.Locale getLocale(java.lang.String languageCode)
Returns Locale from cache where Locale may be specified also using language code. Converts a locale string like "en", "en_US" or "en_US_win" to new Java locale object.


resolveLocaleCode

public static java.lang.String resolveLocaleCode(java.lang.String lang,
                                                 java.lang.String country,
                                                 java.lang.String variant)
Transforms locale data to locale code. null values are allowed.


resolveLocaleCode

public static java.lang.String resolveLocaleCode(java.util.Locale locale)
Resolves locale code from locale.


decodeLocaleCode

public static java.lang.String[] decodeLocaleCode(java.lang.String localeCode)
Decodes locale code in string array that can be used for Locale constructor.


getDateFormatSymbols

public static DateFormatSymbolsEx getDateFormatSymbols(java.util.Locale locale)
Returns DateFormatSymbols instance for specified locale.


getNumberFormat

public static java.text.NumberFormat getNumberFormat(java.util.Locale locale)
Returns NumberFormat instance for specified locale.



Copyright ©2008 Jodd Team