Class I18NTokenizer
java.lang.Object
org.codehaus.plexus.i18n.I18NTokenizer
- All Implemented Interfaces:
Iterator
-
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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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
-
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
-