Package org.codehaus.plexus.i18n
Class I18NTokenizer
- java.lang.Object
-
- org.codehaus.plexus.i18n.I18NTokenizer
-
- All Implemented Interfaces:
java.util.Iterator
public class I18NTokenizer extends java.lang.Object implements java.util.IteratorParses the HTTPAccept-Languageheader 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 Classes Modifier and Type Class Description private classI18NTokenizer.AcceptLanguageStruct representing an element of the HTTPAccept-Languageheader.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.FloatDEFAULT_QUALITYThe default quality value for anAcceptLanguageobject.private static java.lang.StringLOCALE_SEPARATORSeparates elements of theAccept-LanguageHTTP header.private java.util.ArrayListlocalesThe parsed locales.private static charQUALITY_SEPARATORSeparates locale from quality within elements.
-
Constructor Summary
Constructors Constructor Description I18NTokenizer(java.lang.String header)Parses theAccept-Languageheader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasNext()java.lang.Objectnext()Creates aLocalefrom the next element of theAccept-Languageheader.voidremove()Not implemented.
-
-
-
Field Detail
-
LOCALE_SEPARATOR
private static final java.lang.String LOCALE_SEPARATOR
Separates elements of theAccept-LanguageHTTP header.- See Also:
- Constant Field Values
-
QUALITY_SEPARATOR
private static final char QUALITY_SEPARATOR
Separates locale from quality within elements.- See Also:
- Constant Field Values
-
DEFAULT_QUALITY
private static final java.lang.Float DEFAULT_QUALITY
The default quality value for anAcceptLanguageobject.
-
locales
private java.util.ArrayList locales
The parsed locales.
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator- Returns:
- Whether there are more locales.
-
next
public java.lang.Object next()
Creates aLocalefrom the next element of theAccept-Languageheader.- Specified by:
nextin interfacejava.util.Iterator- Returns:
- The next highest-rated
Locale. - Throws:
java.util.NoSuchElementException- No more locales.
-
remove
public final void remove()
Not implemented.- Specified by:
removein interfacejava.util.Iterator
-
-