HeaderTokenizer.Token (Java EE 5)

Java EE API


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 Object

Contained within: HeaderTokenizer

Token 类表示 HeaderTokenizer 返回的标记。
英文文档:

The Token class represents tokens returned by the HeaderTokenizer.


Field Summary
static int
static int
static int
static int
 
Constructor Summary
 
Method Summary
 int
 String
 
Methods inherited from class java.lang.Object
 

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

public HeaderTokenizer.Token(int type, String value)
构造方法。
type Token 类型
value Token 值
英文文档:

HeaderTokenizer.Token

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

Parameters:
type - Token type
value - Token value

Method Detail

public int getType()
返回标记的类型。如果标记表示分界符或控制字符,则类型是该字符本身,并转换为整数。否则,其值是下列值之一:
  • ATOM ASCII 字符序列,由空格、CTL、"("、<"> 或指定的特殊字符分隔
  • QUOTEDSTRING 包含在引号内的 ASCII 字符序列
  • COMMENT 包含在 "(" 和 ")" 内的 ASCII 字符序列
  • EOF 头的末尾
英文文档:

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 SPECIALS
  • QUOTEDSTRING A sequence of ASCII characters within quotes
  • COMMENT A sequence of ASCII characters within "(" and ")".
  • EOF End of header


public String getValue()
返回刚刚读取的标记值。当前标记是一个带引号的字符串时,此字段将包含该字符串的正文,不带引号。当前标记是一个注释时,此字段将包含该注释的正文。
return 标记值
英文文档:

getValue

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


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!