Message.RecipientType (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.mail Class Message.RecipientType

java.lang.Object
  extended by javax.mail.Message.RecipientType
所有已实现的接口:
Serializable
直接已知子类:
MimeMessage.RecipientType
封闭类:
Message

public static class Message.RecipientType
extends Object
implements Serializable

This inner class defines the types of recipients allowed by the Message class. The currently defined types are TO, CC and BCC. Note that this class only has a protected constructor, thereby restricting new Recipient types to either this class or subclasses. This effectively implements an enumeration of the allowed Recipient types. The following code sample shows how to use this class to obtain the "TO" recipients from a message.


 Message msg = folder.getMessages(1);
 Address[] a = m.getRecipients(Message.RecipientType.TO);

 

另请参见:
Message.getRecipients(javax.mail.Message.RecipientType), Message.setRecipients(javax.mail.Message.RecipientType, javax.mail.Address[]), Message.addRecipients(javax.mail.Message.RecipientType, javax.mail.Address[]), Serialized Form

字段摘要
static Message.RecipientType BCC
          The "Bcc" (blind carbon copy) recipients.
static Message.RecipientType CC
          The "Cc" (carbon copy) recipients.
static Message.RecipientType TO
          The "To" (primary) recipients.
protected  String type
          The type of recipient, usually the name of a corresponding Internet standard header.
 
构造器摘要
protected Message.RecipientType(String type)
          Constructor for use by subclasses.
 
方法摘要
protected  Object readResolve()
          When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class.
 String toString()
           
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

TO

public static final Message.RecipientType TO
The "To" (primary) recipients.


CC

public static final Message.RecipientType CC
The "Cc" (carbon copy) recipients.


BCC

public static final Message.RecipientType BCC
The "Bcc" (blind carbon copy) recipients.


type

protected String type
The type of recipient, usually the name of a corresponding Internet standard header.

构造器详细信息

Message.RecipientType

protected Message.RecipientType(String type)
Constructor for use by subclasses.

方法详细信息

readResolve

protected Object readResolve()
                      throws ObjectStreamException
When deserializing a RecipientType, we need to make sure to return only one of the known static final instances defined in this class. Subclasses must implement their own readResolve method that checks for their known instances before calling this super method.

抛出异常:
ObjectStreamException

toString

public String toString()
重写:
toString in class Object

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.