org.codehaus.plexus.i18n
public class I18NTokenizer extends Object implements Iterator
Accept-Language
header as per section
14.4 of RFC 2068 (HTTP 1.1 header field definitions).
Version: $Id: I18NTokenizer.java 1031 2004-09-23 18:42:42Z jvanzyl $
UNKNOWN: Move this class out of here as its purely web related.
Nested Class Summary | |
---|---|
class | I18NTokenizer.AcceptLanguage
Struct representing an element of the HTTP
Accept-Language header. |
Field Summary | |
---|---|
static Float | DEFAULT_QUALITY
The default quality value for an AcceptLanguage
object. |
ArrayList | locales
The parsed locales. |
static String | LOCALE_SEPARATOR
Separates elements of the Accept-Language HTTP
header. |
static char | QUALITY_SEPARATOR
Separates locale from quality within elements. |
Constructor Summary | |
---|---|
I18NTokenizer(String header)
Parses the Accept-Language header.
|
Method Summary | |
---|---|
boolean | hasNext() |
Object | next()
Creates a Locale from the next element of the
Accept-Language header.
|
void | remove()
Not implemented. |
AcceptLanguage
object.Accept-Language
HTTP
header.Accept-Language
header.
Parameters: header The Accept-Language
header
(i.e. en, es;q=0.8, zh-TW;q=0.1
).
Returns: Whether there are more locales.
Locale
from the next element of the
Accept-Language
header.
Returns: The next highest-rated Locale
.
Throws: NoSuchElementException No more locales.