Top Description Fields Constructors Methods
javax.mail

public Class MessageContext

extends Object
Class Inheritance

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
javax.mail.MessageAware, javax.activation.DataSource, javax.activation.DataContentHandler

Field Summary

Modifier and TypeField and Description
private Part

Constructor Summary

AccessConstructor and Description
public
MessageContext(Part
the Part
part
)

Create a MessageContext object describing the context of the given Part.

Method Summary

Modifier and TypeMethod and Description
public Message

Returns:

the containing Message, or null if not known
getMessage
()

Return the Message that contains the content.

private static Message

Returns:

the containing Message, or null if none
getMessage
(Part p)

Return the Message containing an arbitrary Part.

public Part

Returns:

the containing Part, or null if not known
getPart
()

Return the Part that contains the content.

public Session

Returns:

the Session, or null if not known
getSession
()

Return the Session we're operating in.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

partback to summary
private Part part

Constructor Detail

MessageContextback to summary
public MessageContext(Part part)

Create a MessageContext object describing the context of the given Part.

Parameters
part:Part

the Part

Method Detail

getMessageback to summary
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:Message

the containing Message, or null if not known

getMessageback to summary
private static Message getMessage(Part p) throws MessagingException

Return the Message containing an arbitrary Part. Follows the parent chain up through containing Multipart objects until it comes to a Message object, or null.

Returns:Message

the containing Message, or null if none

See Also
javax.mail.BodyPart#getParent, javax.mail.Multipart#getParent
getPartback to summary
public Part getPart()

Return the Part that contains the content.

Returns:Part

the containing Part, or null if not known

getSessionback to summary
public Session getSession()

Return the Session we're operating in.

Returns:Session

the Session, or null if not known