Module com.sun.xml.messaging.saaj
Class HeaderTokenizer
java.lang.Object
com.sun.xml.messaging.saaj.packaging.mime.internet.HeaderTokenizer
This class tokenizes RFC822 and MIME headers into the basic
symbols specified by RFC822 and MIME.
This class handles folded headers (ie headers with embedded CRLF SPACE sequences). The folds are removed in the returned tokens.
- Version:
- 1.9, 02/03/27
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The Token class represents tokens returned by the HeaderTokenizer. -
Field Summary
-
Constructor Summary
ConstructorDescriptionHeaderTokenizer
(String header) Constructor.HeaderTokenizer
(String header, String delimiters) Constructor.HeaderTokenizer
(String header, String delimiters, boolean skipComments) Constructor that takes a rfc822 style header. -
Method Summary
-
Field Details
-
RFC822
RFC822 specials- See Also:
-
MIME
MIME specials- See Also:
-
-
Constructor Details
-
HeaderTokenizer
Constructor that takes a rfc822 style header.- Parameters:
header
- The rfc822 header to be tokenizeddelimiters
- Set of delimiter characters to be used to delimit ATOMS. These are usuallyRFC822
orMIME
skipComments
- If true, comments are skipped and not returned as tokens
-
HeaderTokenizer
Constructor. Comments are ignored and not returned as tokens- Parameters:
header
- The header that is tokenizeddelimiters
- The delimiters to be used
-
HeaderTokenizer
Constructor. The RFC822 defined delimiters - RFC822 - are used to delimit ATOMS. Also comments are skipped and not returned as tokens- Parameters:
header
- The header that is tokenized.
-
-
Method Details
-
next
Parses the next token from this String.Clients sit in a loop calling next() to parse successive tokens until an EOF Token is returned.
- Returns:
- the next Token
- Throws:
ParseException
- if the parse fails
-
peek
Peek at the next token, without actually removing the token from the parse stream. Invoking this method multiple times will return successive tokens, untilnext()
is called.- Returns:
- the next Token
- Throws:
ParseException
- if the parse fails
-
getRemainder
Return the rest of the Header.- Returns:
- String rest of header. null is returned if we are already at end of header
-