This class models an email message. This is an abstract class. Subclasses provide actual implementations. Message implements the Part interface. Message contains a set of attributes and a "content". Messages within a folder also have a set of flags that describe its state within the folder.
| 55 | */ |
| 56 | |
| 57 | public abstract class Message implements Part { |
| 58 | |
| 59 | /** |
| 60 | * The number of this message within its folder, or zero if |
| 61 | * the message was not retrieved from a folder. |
| 62 | */ |
| 63 | protected int msgnum = 0; |
| 64 | |
| 65 | /** |
| 66 | * True if this message has been expunged. |
| 67 | */ |
| 68 | protected boolean expunged = false; |
| 69 | |
| 70 | /** |
| 71 | * The containing folder, if this message is obtained from a folder |
| 72 | */ |
| 73 | protected Folder folder = null; |
| 74 | |
| 75 | /** |
| 76 | * The Session object for this Message |
| 77 | */ |
| 78 | protected Session session = null; |
| 79 | |
| 80 | /** |
| 81 | * No-arg version of the constructor. |
| 82 | */ |
| 83 | protected Message() { } |
| 84 | |
| 85 | /** |
| 86 | * Constructor that takes a Folder and a message number. |
| 87 | * Used by Folder implementations. |
| 88 | * |
| 89 | * @param folder containing folder |
| 90 | * @param msgnum this message's sequence number within this folder |
| 91 | */ |
| 92 | protected Message(Folder folder, int msgnum) { |
| 93 | this.folder = folder; |
| 94 | this.msgnum = msgnum; |
| 95 | session = folder.store.session; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Constructor that takes a Session. Used for client created |
| 100 | * Message objects. |
| 101 | * |
| 102 | * @param session A Session object |
| 103 | */ |
| 104 | protected Message(Session session) { |
| 105 | this.session = session; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Return the Session used when this message was created. |
| 110 | * |
| 111 | * @return the message's Session |
| 112 | * @since JavaMail 1.5 |
| 113 | */ |
| 114 | public Session getSession() { |
nothing calls this directly
no outgoing calls
no test coverage detected