public class I18NTokenizer
extends java.lang.Object
implements java.util.Iterator
Accept-Language
header as per section
14.4 of RFC 2068 (HTTP 1.1 header field definitions).Modifier and Type | Class and Description |
---|---|
private class |
I18NTokenizer.AcceptLanguage
Struct representing an element of the HTTP
Accept-Language header. |
Modifier and Type | Field and Description |
---|---|
private static java.lang.Float |
DEFAULT_QUALITY
The default quality value for an
AcceptLanguage
object. |
private static java.lang.String |
LOCALE_SEPARATOR
Separates elements of the
Accept-Language HTTP
header. |
private java.util.ArrayList |
locales
The parsed locales.
|
private static char |
QUALITY_SEPARATOR
Separates locale from quality within elements.
|
Constructor and Description |
---|
I18NTokenizer(java.lang.String header)
Parses the
Accept-Language header. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
java.lang.Object |
next()
Creates a
Locale from the next element of the
Accept-Language header. |
void |
remove()
Not implemented.
|
private static final java.lang.String LOCALE_SEPARATOR
Accept-Language
HTTP
header.private static final char QUALITY_SEPARATOR
private static final java.lang.Float DEFAULT_QUALITY
AcceptLanguage
object.private java.util.ArrayList locales
public I18NTokenizer(java.lang.String header)
Accept-Language
header.header
- The Accept-Language
header
(i.e. en, es;q=0.8, zh-TW;q=0.1
).public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
Locale
from the next element of the
Accept-Language
header.next
in interface java.util.Iterator
Locale
.java.util.NoSuchElementException
- No more locales.public final void remove()
remove
in interface java.util.Iterator