org.apache.myfaces.util
Class LocaleUtils

java.lang.Object
  extended by org.apache.myfaces.util.LocaleUtils

public class LocaleUtils
extends java.lang.Object

Version:
$Revision$ $Date$
Author:
Anton Koinov (latest modification by $Author$)

Method Summary
static java.util.Locale converterTagLocaleFromString(java.lang.String name)
          Convert locale string used by converter tags to locale.
static java.util.Locale toLocale(java.lang.String localeString)
          Converts a locale string to Locale class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toLocale

public static java.util.Locale toLocale(java.lang.String localeString)
Converts a locale string to Locale class. Accepts both '_' and '-' as separators for locale components.

Parameters:
localeString - string representation of a locale
Returns:
Locale instance, compatible with the string representation

converterTagLocaleFromString

public static java.util.Locale converterTagLocaleFromString(java.lang.String name)
Convert locale string used by converter tags to locale.

Parameters:
name - name of the locale
Returns:
locale specified by the given String
See Also:
ConvertDateTimeTag.setConverterLocale(javax.faces.context.FacesContext, javax.faces.convert.DateTimeConverter, java.lang.String), ConvertNumberTag.setConverterLocale(javax.faces.context.FacesContext, javax.faces.convert.NumberConverter, java.lang.String)