MessageContext (Java EE 5)

Java EE API


javax.mail Class MessageContext

java.lang.Object
  extended by javax.mail.MessageContext

public class MessageContext
extends Object


包含 Message 内容的某个片段的上下文。MessageAware 接口的 getMessageContext 方法返回 MessageContext 对象。MessageAware 通常由 DataSources 实现,以允许 DataContentHandler 传递有关操作数据内容对象所在上下文的信息。
英文文档:

The context in which a piece of Message content is contained. A MessageContext object is returned by the getMessageContext method of the MessageAware interface. MessageAware is typically implemented by DataSources to allow a DataContentHandler to pass on information about the context in which a data content object is operating.

Since:
JavaMail 1.1
See Also:
MessageAware, DataSource, DataContentHandler

Constructor Summary
 
Method Summary
 Message
 Part
 Session
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public MessageContext(Part part)
创建描述给定 Part 的上下文的 MessageContext 对象。
英文文档:

MessageContext

public MessageContext(Part part)
Create a MessageContext object describing the context of the given Part.

Method Detail

public Part getPart()
返回包含内容的 Part。
return 包含内容的 Part;如果未知,则返回 null
英文文档:

getPart

public Part getPart()
Return the Part that contains the content.

Returns:
the containing Part, or null if not known

public Message getMessage()
返回包含内容的 Message。沿父 Message 对象链从头到尾搜索包含内容的 Multipart 对象,直到找到某个 Message 对象为止;或者返回 null。
return 包含内容的 Message;如果未知,则返回 null
英文文档:

getMessage

public Message getMessage()
Return the Message that contains the content. Follows the parent chain up through containing Multipart objects until it comes to a Message object, or null.

Returns:
the containing Message, or null if not known

public Session getSession()
返回正操作的 Session。
return Session;如果未知,则返回 null
英文文档:

getSession

public Session getSession()
Return the Session we're operating in.

Returns:
the Session, or null if not known


Submit a bug or feature

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

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

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