javax.mail

Class MessageContext

public class MessageContext extends Object

The context in which a piece of message content is contained.
Constructor Summary
MessageContext(Part part)
Create a MessageContext object describing the context of the supplied Part.
Method Summary
MessagegetMessage()
Return the message that contains the content; if the Part is a Multipart then recurse up the chain until a Message is found.
PartgetPart()
Return the Part that contains the content.
SessiongetSession()
Return the session associated with the Message containing this Part.

Constructor Detail

MessageContext

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

Parameters: part the containing part

Method Detail

getMessage

public Message getMessage()
Return the message that contains the content; if the Part is a Multipart then recurse up the chain until a Message is found.

Returns:

getPart

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

Returns: the part

getSession

public Session getSession()
Return the session associated with the Message containing this Part.

Returns: the session associated with this context's root message