javax.mail.internet
Class HeaderTokenizer.Token

java.lang.Object
  extended by javax.mail.internet.HeaderTokenizer.Token
Enclosing class:
HeaderTokenizer

public static class HeaderTokenizer.Token
extends java.lang.Object

The Token class represents tokens returned by the HeaderTokenizer.


Field Summary
static int ATOM
          Token type indicating an ATOM.
static int COMMENT
          Token type indicating a comment.
static int EOF
          Token type indicating end of input.
static int QUOTEDSTRING
          Token type indicating a quoted string.
 
Constructor Summary
HeaderTokenizer.Token(int type, java.lang.String value)
          Constructor.
 
Method Summary
 int getType()
          Return the type of the token.
 java.lang.String getValue()
          Returns the value of the token just read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATOM

public static final int ATOM
Token type indicating an ATOM.

See Also:
Constant Field Values

QUOTEDSTRING

public static final int QUOTEDSTRING
Token type indicating a quoted string. The value field contains the string without the quotes.

See Also:
Constant Field Values

COMMENT

public static final int COMMENT
Token type indicating a comment. The value field contains the comment string without the comment start and end symbols.

See Also:
Constant Field Values

EOF

public static final int EOF
Token type indicating end of input.

See Also:
Constant Field Values
Constructor Detail

HeaderTokenizer.Token

public HeaderTokenizer.Token(int type,
                             java.lang.String value)
Constructor.

Parameters:
type - Token type
value - Token value
Method Detail

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:


getValue

public java.lang.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


Submit a bug or feature

Copyright © 2009, 2010, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 4-June-2010 04:34