org.apache.myfaces.util

Class LocaleUtils


public class LocaleUtils
extends java.lang.Object

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

Method Summary

static Locale
converterTagLocaleFromString(String name)
Convert locale string used by converter tags to locale.
static Locale
toLocale(String localeString)
Converts a locale string to Locale class.

Method Details

converterTagLocaleFromString

public static Locale converterTagLocaleFromString(String name)
Convert locale string used by converter tags to locale.
Parameters:
name - name of the locale
Returns:
locale specified by the given String

toLocale

public static Locale toLocale(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