This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.mail.internet
class HeaderTokenizer

javax.mail.internet.HeaderTokenizer

public class HeaderTokenizer
extends Object

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.


Nested Class Summary
static class

           The Token class represents tokens returned by the HeaderTokenizer.
 
Field Summary
static String MIME
          MIME specials
static String RFC822
          RFC822 specials
 
Constructor Summary

          Constructor.
HeaderTokenizer(String header, String delimiters)

          Constructor.
HeaderTokenizer(String header, String delimiters, boolean skipComments)

          Constructor that takes a rfc822 style header.
 
Method Summary
 String

          Return the rest of the Header.
 HeaderTokenizer.Token

          Parses the next token from this String.
 HeaderTokenizer.Token

          Peek at the next token, without actually removing the token from the parse stream.
 

Field Detail

MIME

public static final String MIME
MIME specials

RFC822

public static final String RFC822
RFC822 specials
Constructor Detail

HeaderTokenizer

public HeaderTokenizer(String header)
Constructor. The RFC822 defined delimiters - RFC822 - are used to delimit ATOMS. Also comments are skipped and not returned as tokens

Parameters:
header

HeaderTokenizer

public HeaderTokenizer(String header,
                       String delimiters)
Constructor. Comments are ignored and not returned as tokens

Parameters:
header - The header that is tokenized
delimiters - The delimiters to be used

HeaderTokenizer

public HeaderTokenizer(String header,
                       String delimiters,
                       boolean skipComments)
Constructor that takes a rfc822 style header.

Parameters:
header - The rfc822 header to be tokenized
delimiters - Set of delimiter characters to be used to delimit ATOMS. These are usually RFC822 or MIME
skipComments - If true, comments are skipped and not returned as tokens
Method Detail

getRemainder

public String getRemainder()
Return the rest of the Header.

Returns:
String rest of header. null is returned if we are already at end of header

next

public HeaderTokenizer.Token next()
                           throws ParseException
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

public HeaderTokenizer.Token peek()
                           throws ParseException
Peek at the next token, without actually removing the token from the parse stream. Invoking this method multiple times will return successive tokens, until next() is called.

Returns:
the next Token
Throws:
ParseException - if the parse fails


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.