java.lang.Object
jakarta.mail.MessageContext
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMessageContext
(Part part) Create a MessageContext object describing the context of the given Part. -
Method Summary
Modifier and TypeMethodDescriptionReturn the Message that contains the content.private static Message
getMessage
(Part p) Return the Message containing an arbitrary Part.getPart()
Return the Part that contains the content.Return the Session we're operating in.
-
Field Details
-
part
-
-
Constructor Details
-
MessageContext
Create a MessageContext object describing the context of the given Part.- Parameters:
part
- the Part
-
-
Method Details
-
getPart
Return the Part that contains the content.- Returns:
- the containing Part, or null if not known
-
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
-
getMessage
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:
- the containing Message, or null if none
- Throws:
MessagingException
- See Also:
-
getSession
Return the Session we're operating in.- Returns:
- the Session, or null if not known
-