public abstract class LocaleUtil
extends Object
Utility class for locale handling.
-
Constructor Summary
Constructors
-
Method Summary
Parses the given text to create its corresponding
Locale.
Converts the given locale to RFC 4646 format.
-
Constructor Details
-
LocaleUtil
public LocaleUtil()
-
Method Details
-
parseLocale
Parses the given text to create its corresponding
Locale. This
method supports "-" and "_" as locale element separator.
- Parameters:
text - string to parse
- Returns:
- the
Locale
-
toRFC4646
Converts the given locale to RFC 4646 format. e.g. "en_US" to "en-US".
- Parameters:
locale - the Locale to convert to RFC 4646 format
- Returns:
- the string in RFC 4646 format corresponding to the submitted
Locale