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, waitMethods 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:TokenIteratorIndicates whether there is another token in this iteration.- Specified by:
hasNextin interfaceIterator<Object>- Specified by:
hasNextin interfaceTokenIterator- Returns:
trueif there is another token,falseotherwise
-
nextToken
Obtains the next token from this iteration.- Specified by:
nextTokenin 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:
nextin 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:
removein interfaceIterator<Object>- Throws:
UnsupportedOperationException- always
-