Package org.simpleframework.http.parse
Class CookieParser.Sequence
java.lang.Object
org.simpleframework.http.parse.CookieParser.Sequence
- Enclosing class:
CookieParser
This is used to represent an
Iterator
that will
iterate over the available cookies within the provided source
text. This allows the cookie parser to be used as an iterable
with for each loops. Cookies can not be removed with this.-
Constructor Details
-
Sequence
private Sequence()
-
-
Method Details
-
next
Extracts the nextCookie
object from the string given. This will returnnull
when there are no more cookies left in theString
being parsed.To find out when there are no more cookies left use the
hasNext
method. This will only set the name, value, path, domain name version of thecookie
because as of RFC 2109 these are the only attributes aCookie
may have, the path and domain are optional. -
hasNext
public boolean hasNext()Determine whether or not there are anyCookie
s left in theString
. This will attempt to extract anotherCookie
from theString
and cache the result so thenext
method will produce thisCookie
. If anotherCookie
cannot be parsed from the remainder of theString
then this will returnfalse
otherwise it will returntrue
. -
remove
public void remove()This method is used to remove items from the iterator. This however performs no action as the act of parsing should not modify the underlying source text value so that it can be reset with thereset
method and used again.
-