Package jakarta.mail

Class MessageContext

  • public class MessageContext
    extends Object
    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.
    JavaMail 1.1
    See Also:
    MessageAware, DataSource, DataContentHandler
    • Constructor Detail

      • MessageContext

        public MessageContext​(Part part)
        Create a MessageContext object describing the context of the given Part.
        part - the Part
    • Method Detail

      • getPart

        public Part getPart()
        Return the Part that contains the content.
        the containing Part, or null if not known
      • getMessage

        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.
        the containing Message, or null if not known
      • getSession

        public Session getSession()
        Return the Session we're operating in.
        the Session, or null if not known