javax.mail

Class MessageContext


public class MessageContext
extends java.lang.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

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.
Part
getPart()
Return the Part that contains the content.
Session
getSession()
Return the session associated with the Message containing this Part.

Constructor Details

MessageContext

public MessageContext(Part part)
Create a MessageContext object describing the context of the supplied Part.
Parameters:
part - the containing part

Method Details

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