|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.mail.Message
public abstract class Message
| Nested Class Summary | |
|---|---|
static class |
Message.RecipientType
Enumeration of types of recipients allowed by the Message class. |
| Field Summary | |
|---|---|
protected boolean |
expunged
True if this message has been expunged from the Store. |
protected Folder |
folder
The Folder that contains this message, or null if it was not obtained from a folder. |
protected int |
msgnum
The index of a message withing its folder, or zero if the message was not retrieved from a folder. |
protected Session |
session
The Session associated with this message. |
| Fields inherited from interface javax.mail.Part |
|---|
ATTACHMENT, INLINE |
| Constructor Summary | |
|---|---|
protected |
Message()
Default constructor. |
protected |
Message(Folder folder,
int msgnum)
Constructor initializing folder and message msgnum; intended to be used by implementations of Folder. |
protected |
Message(Session session)
Constructor initializing the session; intended to by used by client created instances. |
| Method Summary | |
|---|---|
abstract void |
addFrom(Address[] addresses)
Add multiple addresses to the "From" header. |
void |
addRecipient(Message.RecipientType type,
Address address)
Add a recipent of a specified type. |
abstract void |
addRecipients(Message.RecipientType type,
Address[] addresses)
Add recipents of a specified type. |
Address[] |
getAllRecipients()
Get all recipients of this message. |
abstract Flags |
getFlags()
Return a copy the flags associated with this message. |
Folder |
getFolder()
Return the folder containing this message. |
abstract Address[] |
getFrom()
Return the "From" header indicating the identity of the person who the message is from; in some circumstances this may be different to the actual sender. |
int |
getMessageNumber()
Return the message number for this Message. |
abstract Date |
getReceivedDate()
Return the date this message was received. |
abstract Address[] |
getRecipients(Message.RecipientType type)
Get all recipients of the given type. |
Address[] |
getReplyTo()
Get the addresses to which replies should be directed. |
abstract Date |
getSentDate()
Return the date that this message was sent. |
abstract String |
getSubject()
Get the subject for this message. |
boolean |
isExpunged()
Checks to see if this message has been expunged. |
boolean |
isSet(Flags.Flag flag)
Check whether the supplied flag is set. |
boolean |
match(SearchTerm term)
Apply the specified search criteria to this message |
abstract Message |
reply(boolean replyToAll)
Create a new message suitable as a reply to this message with all headers set up appropriately. |
abstract void |
saveChanges()
To ensure changes are saved to the store, this message should be invoked before its containing folder is closed. |
protected void |
setExpunged(boolean expunged)
Set the expunged flag for this message. |
void |
setFlag(Flags.Flag flag,
boolean set)
Set a flag to the supplied value. |
abstract void |
setFlags(Flags flags,
boolean set)
Set the flags specified to the supplied value; flags not included in the supplied Flags parameter are not affected. |
abstract void |
setFrom()
Set the "From" header for this message to the value of the "mail.user" property, of if that property is not set, to the value of the system property "user.name" |
abstract void |
setFrom(Address address)
Set the "From" header to the supplied address. |
protected void |
setMessageNumber(int number)
Set the message number for this Message. |
void |
setRecipient(Message.RecipientType type,
Address address)
Set the list of recipients for the specified type to a single address. |
abstract void |
setRecipients(Message.RecipientType type,
Address[] addresses)
Set the list of recipients for the specified type. |
void |
setReplyTo(Address[] addresses)
Set the addresses to which replies should be directed. |
abstract void |
setSentDate(Date sent)
Set the date this message was sent. |
abstract void |
setSubject(String subject)
Set the subject of this message |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.mail.Part |
|---|
addHeader, getAllHeaders, getContent, getContentType, getDataHandler, getDescription, getDisposition, getFileName, getHeader, getInputStream, getLineCount, getMatchingHeaders, getNonMatchingHeaders, getSize, isMimeType, removeHeader, setContent, setContent, setDataHandler, setDescription, setDisposition, setFileName, setHeader, setText, writeTo |
| Field Detail |
|---|
protected int msgnum
protected boolean expunged
protected Folder folder
Folder that contains this message, or null if it was not obtained from a folder.
protected Session session
Session associated with this message.
| Constructor Detail |
|---|
protected Message()
protected Message(Folder folder,
int msgnum)
folder - the folder that contains the messagemsgnum - the message index within the folderprotected Message(Session session)
session - the session associated with this message| Method Detail |
|---|
public abstract Address[] getFrom()
throws MessagingException
MessagingException - if there was a problem accessing the store
public abstract void setFrom()
throws MessagingException
MessagingException - if there was a problem accessing the store
public abstract void setFrom(Address address)
throws MessagingException
address - the address of the person who the message is from
MessagingException - if there was a problem accessing the store
public abstract void addFrom(Address[] addresses)
throws MessagingException
addresses - the addresses to add
MessagingException - if there was a problem accessing the store
public abstract Address[] getRecipients(Message.RecipientType type)
throws MessagingException
type - the type of recipient to get
MessagingException - if there was a problem accessing the storeMessage.RecipientType
public Address[] getAllRecipients()
throws MessagingException
getRecipients(javax.mail.Message.RecipientType)
and then concatentates the results into a single array; it returns null if no headers are defined.
MessagingException - if there was a problem accessing the store
public abstract void setRecipients(Message.RecipientType type,
Address[] addresses)
throws MessagingException
type - the type of recipientaddresses - the new addresses
MessagingException - if there was a problem accessing the store
public void setRecipient(Message.RecipientType type,
Address address)
throws MessagingException
type - the type of recipientaddress - the new address
MessagingException - if there was a problem accessing the store
public abstract void addRecipients(Message.RecipientType type,
Address[] addresses)
throws MessagingException
type - the type of recipientaddresses - the addresses to add
MessagingException - if there was a problem accessing the store
public void addRecipient(Message.RecipientType type,
Address address)
throws MessagingException
type - the type of recipientaddress - the address to add
MessagingException - if there was a problem accessing the store
public Address[] getReplyTo()
throws MessagingException
getFrom().
MessagingException - if there was a problem accessing the store
public void setReplyTo(Address[] addresses)
throws MessagingException
addresses - to which replies should be directed
MessagingException - if there was a problem accessing the store
public abstract String getSubject()
throws MessagingException
MessagingException - if there was a problem accessing the store
public abstract void setSubject(String subject)
throws MessagingException
subject - the subject
MessagingException - if there was a problem accessing the store
public abstract Date getSentDate()
throws MessagingException
MessagingException - if there was a problem accessing the store
public abstract void setSentDate(Date sent)
throws MessagingException
sent - the date when this message was sent
MessagingException - if there was a problem accessing the store
public abstract Date getReceivedDate()
throws MessagingException
MessagingException - if there was a problem accessing the store
public abstract Flags getFlags()
throws MessagingException
MessagingException - if there was a problem accessing the store
public boolean isSet(Flags.Flag flag)
throws MessagingException
getFlags().
flag - the flags to check for
MessagingException - if there was a problem accessing the store
public abstract void setFlags(Flags flags,
boolean set)
throws MessagingException
Flags parameter are not affected.
flags - the flags to modifyset - the new value of those flags
MessagingException - if there was a problem accessing the store
public void setFlag(Flags.Flag flag,
boolean set)
throws MessagingException
setFlags(Flags, boolean).
flag - the flag to setset - the value for that flag
MessagingException - if there was a problem accessing the storepublic int getMessageNumber()
protected void setMessageNumber(int number)
number - the new message numberpublic Folder getFolder()
public boolean isExpunged()
getMessageNumber() are invalid.
protected void setExpunged(boolean expunged)
expunged - true if this message has been expunged
public abstract Message reply(boolean replyToAll)
throws MessagingException
getReplyTo().
The subject field will be initialized with the subject field from the orginal
message; the text "Re:" will be prepended unless it is already present.
replyToAll - if true, indciates the message should be addressed to all recipients not just the sender
MessagingException - if there was a problem accessing the store
public abstract void saveChanges()
throws MessagingException
MessagingException - if there was a problem accessing the store
public boolean match(SearchTerm term)
throws MessagingException
term - the search criteria
MessagingException - if there was a problem accessing the store
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||