|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cometway.props.Props
com.cometway.email.Message
public class Message
Message is an IMessage that represents an RFC822 compliant message. A Message is required to have at least the 'To' and 'From' headers (though these headers may be empty)
| Field Summary | |
|---|---|
static java.lang.String |
HEADER_NOT_FOUND
|
| Constructor Summary | |
|---|---|
Message()
A constructor for creating an empty Message with empty 'To' and 'From' fields |
|
Message(java.lang.String entireMessage)
A constructor for creating a Message from a String |
|
Message(java.lang.String headerInfo,
java.lang.String message)
A constructor for creating a Message with the specified headers and message body |
|
Message(java.lang.String from,
java.lang.String to,
java.lang.String message)
A constructor for creating a Message with the specified 'To' and 'From' fields and message body |
|
| Method Summary | |
|---|---|
java.lang.String |
getHeaderInfo(java.lang.String key)
Given a key, method returns the value of the header referenced by key if any |
java.util.Enumeration |
getHeaders()
Method yields an Enumeration of header keys for this Message |
java.lang.String |
getMessage()
getMessage returns the message body of this Message |
void |
removeAllHeaders()
removeAllHeaders removes all headers from this Message |
void |
setHeaderInfo(java.lang.String key,
java.lang.String info)
setHeaderInfo sets the value of a specified header for this Message, adding the header if necessary |
void |
setMessage(java.lang.String s)
setMessage sets the value of the message body for this Message |
java.lang.String |
toString()
Method yields the String representation of this Message |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String HEADER_NOT_FOUND
| Constructor Detail |
|---|
public Message()
public Message(java.lang.String entireMessage)
entireMessage - A String representing the message body and headers for this Message
public Message(java.lang.String from,
java.lang.String to,
java.lang.String message)
from - A String that will be the value of the 'From' header for this Messageto - A String that will be the value of the 'To' header for this Messagemessage - A String that will be the value of the message body for this Message
public Message(java.lang.String headerInfo,
java.lang.String message)
headerInfo - A String representing the headers for this Messagemessage - A String that will be the value of the message body for this Message| Method Detail |
|---|
public java.lang.String getHeaderInfo(java.lang.String key)
getHeaderInfo in interface IMessagekey - the header name to be extractedpublic java.util.Enumeration getHeaders()
getHeaders in interface IMessagepublic java.lang.String getMessage()
getMessage in interface IMessagepublic void removeAllHeaders()
removeAllHeaders in interface IMessage
public void setHeaderInfo(java.lang.String key,
java.lang.String info)
setHeaderInfo in interface IMessagekey - the header name to be setinfo - the header valuepublic void setMessage(java.lang.String s)
setMessage in interface IMessages - the new message bodypublic java.lang.String toString()
toString in interface IMessagetoString in class Props
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||