Top Description Constructors Methods
io.undertow.util

public Class LocaleUtils

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, .Locale

Utility methods for getting the locale from a request.
Author
Stuart Douglas

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Locale
public static List<Locale>

Returns:

The list of locales, in order of preference
getLocalesFromHeader
(final String
The Accept-Language header
acceptLanguage
)

Parse a header string and return the list of locales that were found.

public static List<Locale>

Returns:

The list of locales, in order of preference
getLocalesFromHeader
(final List<String>
The Accept-Language header
acceptLanguage
)

Parse a header string and return the list of locales that were found.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LocaleUtilsback to summary
public LocaleUtils()

Method Detail

getLocaleFromStringback to summary
public static Locale getLocaleFromString(String localeString)
getLocalesFromHeaderback to summary
public static List<Locale> getLocalesFromHeader(final String acceptLanguage)

Parse a header string and return the list of locales that were found. If the header is empty or null then an empty list will be returned.

Parameters
acceptLanguage:String

The Accept-Language header

Returns:List<Locale>

The list of locales, in order of preference

getLocalesFromHeaderback to summary
public static List<Locale> getLocalesFromHeader(final List<String> acceptLanguage)

Parse a header string and return the list of locales that were found. If the header is empty or null then an empty list will be returned.

Parameters
acceptLanguage:List<String>

The Accept-Language header

Returns:List<Locale>

The list of locales, in order of preference