Package jakarta.mail.internet
Class HeaderTokenizer.Token
java.lang.Object
jakarta.mail.internet.HeaderTokenizer.Token
- Enclosing class:
- HeaderTokenizer
The Token class represents tokens returned by the
HeaderTokenizer.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Token type indicating an ATOM.static final int
Token type indicating a comment.static final int
Token type indicating end of input.static final int
Token type indicating a quoted string. -
Constructor Summary
-
Method Summary
-
Field Details
-
ATOM
public static final int ATOMToken type indicating an ATOM.- See Also:
-
QUOTEDSTRING
public static final int QUOTEDSTRINGToken type indicating a quoted string. The value field contains the string without the quotes.- See Also:
-
COMMENT
public static final int COMMENTToken type indicating a comment. The value field contains the comment string without the comment start and end symbols.- See Also:
-
EOF
public static final int EOFToken type indicating end of input.- See Also:
-
-
Constructor Details
-
Token
Constructor.- Parameters:
type
- Token typevalue
- Token value
-
-
Method Details
-
getType
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 SPECIALSQUOTEDSTRING
A sequence of ASCII characters within quotesCOMMENT
A sequence of ASCII characters within "(" and ")".EOF
End of header
- Returns:
- the token type
-
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
-