public static class

HeaderTokenizer.Token

extends Object
java.lang.Object
   ↳ com.google.code.javax.mail.internet.HeaderTokenizer.Token

Class Overview

The Token class represents tokens returned by the HeaderTokenizer.

Summary

Constants
int ATOM Token type indicating an ATOM.
int COMMENT Token type indicating a comment.
int EOF Token type indicating end of input.
int QUOTEDSTRING Token type indicating a quoted string.
Fields
private int type
private String value
Public Constructors
HeaderTokenizer.Token(int type, String value)
Constructor.
Public Methods
int getType()
Return the type of the token.
String getValue()
Returns the value of the token just read.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int ATOM

Token type indicating an ATOM.

Constant Value: -1 (0xffffffff)

public static final int COMMENT

Token type indicating a comment. The value field contains the comment string without the comment start and end symbols.

Constant Value: -3 (0xfffffffd)

public static final int EOF

Token type indicating end of input.

Constant Value: -4 (0xfffffffc)

public static final int QUOTEDSTRING

Token type indicating a quoted string. The value field contains the string without the quotes.

Constant Value: -2 (0xfffffffe)

Fields

private int type

private String value

Public Constructors

public HeaderTokenizer.Token (int type, String value)

Constructor.

Parameters
type Token type
value Token value

Public Methods

public int getType ()

Return the type of the token. If the token represents a delimiter or a control character, the type is that character itself, converted to an integer. Otherwise, it's value is one of the following:

  • ATOM A sequence of ASCII characters delimited by either SPACE, CTL, "(", <"> or the specified SPECIALS
  • QUOTEDSTRING A sequence of ASCII characters within quotes
  • COMMENT A sequence of ASCII characters within "(" and ")".
  • EOF End of header

public String getValue ()

Returns the value of the token just read. When the current token is a quoted string, this field contains the body of the string, without the quotes. When the current token is a comment, this field contains the body of the comment.

Returns
  • token value