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 classStruct representing an element of the HTTPAccept-Languageheader. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FloatThe default quality value for anAcceptLanguageobject.private static final StringSeparates elements of theAccept-LanguageHTTP header.private ArrayListThe parsed locales.private static final charSeparates 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, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
LOCALE_SEPARATOR
Separates elements of theAccept-LanguageHTTP 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 anAcceptLanguageobject. -
locales
The parsed locales.
-
-
Constructor Details
-
I18NTokenizer
Parses theAccept-Languageheader.- Parameters:
header- TheAccept-Languageheader (i.e.en, es;q=0.8, zh-TW;q=0.1).
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
Creates aLocalefrom the next element of theAccept-Languageheader.- Specified by:
nextin interfaceIterator- Returns:
- The next highest-rated
Locale. - Throws:
NoSuchElementException- No more locales.
-
remove
public final void remove()Not implemented.
-