Package org.codehaus.plexus.i18n
Class I18NTokenizer
java.lang.Object
org.codehaus.plexus.i18n.I18NTokenizer
- All Implemented Interfaces:
Iterator
Parses the HTTP
Accept-Language
header as per section
14.4 of RFC 2068 (HTTP 1.1 header field definitions).- Version:
- $Id: I18NTokenizer.java 6675 2007-07-20 23:05:53Z olamy $
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Struct representing an element of the HTTPAccept-Language
header. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Float
The default quality value for anAcceptLanguage
object.private static final String
Separates elements of theAccept-Language
HTTP header.private ArrayList
The parsed locales.private static final char
Separates locale from quality within elements. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
LOCALE_SEPARATOR
Separates elements of theAccept-Language
HTTP header.- See Also:
-
QUALITY_SEPARATOR
private static final char QUALITY_SEPARATORSeparates locale from quality within elements.- See Also:
-
DEFAULT_QUALITY
The default quality value for anAcceptLanguage
object. -
locales
The parsed locales.
-
-
Constructor Details
-
I18NTokenizer
Parses theAccept-Language
header.- Parameters:
header
- TheAccept-Language
header (i.e.en, es;q=0.8, zh-TW;q=0.1
).
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
Creates aLocale
from the next element of theAccept-Language
header.- Specified by:
next
in interfaceIterator
- Returns:
- The next highest-rated
Locale
. - Throws:
NoSuchElementException
- No more locales.
-
remove
public final void remove()Not implemented.
-