- java.lang.Object
- 
- jakarta.mail.MessageContext
 
- 
 public class MessageContext extends java.lang.ObjectThe context in which a piece of Message content is contained. AMessageContextobject is returned by thegetMessageContextmethod of theMessageAwareinterface.MessageAwareis typically implemented byDataSourcesto allow aDataContentHandlerto pass on information about the context in which a data content object is operating.- See Also:
- MessageAware,- DataSource,- DataContentHandler
 
- 
- 
Constructor SummaryConstructors Constructor Description MessageContext(Part part)Create a MessageContext object describing the context of the given Part.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description MessagegetMessage()Return the Message that contains the content.PartgetPart()Return the Part that contains the content.SessiongetSession()Return the Session we're operating in.
 
- 
- 
- 
Constructor Detail- 
MessageContextpublic MessageContext(Part part) Create a MessageContext object describing the context of the given Part.- Parameters:
- part- the Part
 
 
- 
 - 
Method Detail- 
getPartpublic Part getPart() Return the Part that contains the content.- Returns:
- the containing Part, or null if not known
 
 - 
getMessagepublic 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
 
 - 
getSessionpublic Session getSession() Return the Session we're operating in.- Returns:
- the Session, or null if not known
 
 
- 
 
-