Reformulating this specification into proper EBNF as specified by N. Wirth
we get the following productions, which map to the parse METHODS of this
class. Any whitespace is ignored except for white space surrounding and
within words which is considered significant.

An If header either contains untagged IfList entries or
tagged IfList entries but not a mixture of both. An If
header containing tagged entries is said to be of tagged type while
an If header containing untagged entries is said to be of
untagged type.

An IfList is a list of tokens - words enclosed in < >
- and etags - words enclosed in [ ]. An IfList matches a
(token, etag) tuple if all entries in the list match. If an entry in the list
is prefixed with the word Not (parsed case insensitively) the entry
must not match the concrete token or etag.

Example: The ifList(<token> [etag]) only matches
if the concret token has the value token and the conrete etag
has the value etag. On the other hand, the ifList(Not <notoken>) matches any token which is not
notoken (in this case the concrete value of the etag is
not taken into consideration).

Author:

Felix Meschberger

Constructor Summary

IfHeader(javax.servlet.http.HttpServletRequest req)
Parses the If header and creates and internal representation
which is easy to query.

IfHeader(String[] tokens)
Create a Untagged IfHeader if the given lock tokens.

matches

Tries to match the contents of the If header with the given
token and etag values with the restriction to only check for the tag.

If the If header is of untagged type, the untagged IfList
is matched against the token and etag given: A match of the token and
etag is found if at least one of the IfList entries match the
token and etag tupel.

Parameters:

tag - The tag to identify the IfList to match the token
and etag against.

token - The token to compare.

etag - The ETag value to compare.

Returns:

If the If header is of untagged type the result is
true if any of the IfList entries matches
the token and etag values. For tagged type If header the
result is true if either no entry for the given tag
exists in the If header or if the IfList for the
given tag matches the token and etag given.