Package org.apache.http.message
Class BasicTokenIterator
java.lang.Object
org.apache.http.message.BasicTokenIterator
- All Implemented Interfaces:
Iterator<Object>
,TokenIterator
Basic implementation of a
TokenIterator
.
This implementation parses #token
sequences as
defined by RFC 2616, section 2.
It extends that definition somewhat beyond US-ASCII.- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBasicTokenIterator
(HeaderIterator headerIterator) Creates a new instance ofBasicTokenIterator
. -
Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
HTTP_SEPARATORS
The HTTP separator characters. Defined in RFC 2616, section 2.2.- See Also:
-
-
Constructor Details
-
BasicTokenIterator
Creates a new instance ofBasicTokenIterator
.- Parameters:
headerIterator
- the iterator for the headers to tokenize
-
-
Method Details
-
hasNext
public boolean hasNext()Description copied from interface:TokenIterator
Indicates whether there is another token in this iteration.- Specified by:
hasNext
in interfaceIterator<Object>
- Specified by:
hasNext
in interfaceTokenIterator
- Returns:
true
if there is another token,false
otherwise
-
nextToken
Obtains the next token from this iteration.- Specified by:
nextToken
in interfaceTokenIterator
- Returns:
- the next token in this iteration
- Throws:
NoSuchElementException
- if the iteration is already overParseException
- if an invalid header value is encountered
-
next
Returns the next token. Same asnextToken()
, but with generic return type.- Specified by:
next
in interfaceIterator<Object>
- Returns:
- the next token in this iteration
- Throws:
NoSuchElementException
- if there are no more tokensParseException
- if an invalid header value is encountered
-
remove
Removing tokens is not supported.- Specified by:
remove
in interfaceIterator<Object>
- Throws:
UnsupportedOperationException
- always
-