org.codehaus.plexus.i18n
Class I18NTokenizer
java.lang.Object
org.codehaus.plexus.i18n.I18NTokenizer
- Iterator
public class I18NTokenizer
extends java.lang.Object
implements Iterator
Parses the HTTP Accept-Language
header as per section
14.4 of RFC 2068 (HTTP 1.1 header field definitions).
$Id: I18NTokenizer.java 1031 2004-09-23 18:42:42Z jvanzyl $
private static Float | DEFAULT_QUALITY - The default quality value for an
AcceptLanguage
object.
|
private static String | LOCALE_SEPARATOR - Separates elements of the
Accept-Language HTTP
header.
|
private static char | QUALITY_SEPARATOR - Separates locale from quality within elements.
|
private ArrayList | locales - The parsed locales.
|
boolean | hasNext()
|
Object | next() - Creates a
Locale from the next element of the
Accept-Language header.
|
void | remove() - Not implemented.
|
DEFAULT_QUALITY
private static final Float DEFAULT_QUALITY
The default quality value for an AcceptLanguage
object.
LOCALE_SEPARATOR
private static final String LOCALE_SEPARATOR
Separates elements of the Accept-Language
HTTP
header.
QUALITY_SEPARATOR
private static final char QUALITY_SEPARATOR
Separates locale from quality within elements.
locales
private ArrayList locales
The parsed locales.
I18NTokenizer
public I18NTokenizer(String header)
Parses the Accept-Language
header.
header
- The Accept-Language
header
(i.e. en, es;q=0.8, zh-TW;q=0.1
).
hasNext
public boolean hasNext()
- Whether there are more locales.
next
public Object next()
Creates a Locale
from the next element of the
Accept-Language
header.
- The next highest-rated
Locale
.
remove
public final void remove()
Not implemented.