|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.datamanager.simpleton.EmailMessageEntityHelper
Provides a convenient way to access the attributes of an email message represented by an Entity.
Field Summary | |
static String |
EMAIL_ATTRIBUTE_NAME
Attribute name which, along with EMAIL_ATTRIBUTE_VALUE, we use to identify Entities which are email. |
static String |
EMAIL_ATTRIBUTE_VALUE
Attribute name which, along with EMAIL_ATTRIBUTE_NAME, we use to identify Entities which are email. |
static String |
MAIL_CC
String value of the cc mail header. |
static String |
MAIL_CONTENT_TYPE
String value of the content-type mail header. |
static String |
MAIL_DATE
String value of the date mail header. |
static String |
MAIL_DATE_OBJECT
String name of the DateEntityValue associated with this message. |
static String |
MAIL_FROM
String value of the from mail header. |
static String |
MAIL_HTML_CONTENT_TYPE
|
static String |
MAIL_IN_REPLY_TO
String value of the in-reply-to mail header. |
static String |
MAIL_MESSAGE_ID
String value of the message-id mail header. |
static String |
MAIL_PART_IDENTIFIER
String name of the Entity that has as its String value the body of this message. |
static String |
MAIL_PREFERRED_CONTENT_TYPE
|
static String |
MAIL_REPLYTO
String value of the reply-to mail header. |
static String |
MAIL_SUBJECT
String value of the subject mail header. |
static String |
MAIL_TO
String value of the to mail header. |
Constructor Summary | |
EmailMessageEntityHelper()
Creates a new EmailMessageEntityHelper containing a new email message entity with no content. |
|
EmailMessageEntityHelper(Entity message)
Creates a new EmailMessageEntityHelper to access the data in the given message. |
Method Summary | |
Object |
get(String key)
Returns the Object attribute value mapped to the String key passed in. |
String |
getBody()
Returns the first chunk of content in this message, regardless of MIME type. |
String |
getCcAddresses()
Returns the addresses in the Cc: field of the message. |
String |
getContentType()
Returns the lowercased string from the Content-Type: field
of the message, or "text/plain" if no Content-Type: header
is found. |
Date |
getDateObject()
Returns the Date object associated with this message. |
String |
getDateString()
Returns the string from the Date: field of the message. |
String |
getFromAddress()
Returns the address in the From: field of the message. |
String |
getInReplyTo()
Gets the In-Reply-To of the message. |
Entity |
getMessage()
Returns the message this EmailMessageEntityHelper is helping with. |
String |
getMessageId()
Gets the Message-ID of the message. |
String |
getReplyToAddress()
Gets the reply-to address of the message. |
String |
getSubject()
Returns the subject of the message. |
String |
getToAddresses()
Returns the addresses in the To: field of the message. |
void |
replaceStringAttribute(String name,
String value)
Replaces the value of the attribute named name with the
value value . |
void |
setBody(String body)
Sets the first chunk of content in this message (part0) to be the given String. |
void |
setCcAddresses(String addresses)
Sets the cc addresses of the message. |
void |
setContentType(String contentType)
Sets the content type of the message. |
void |
setDateObject(Date date)
Sets the date object of the message. |
void |
setDateString(String date)
Sets the date field of the message. |
void |
setFromAddress(String address)
Sets the from address of the message. |
void |
setInReplyTo(String messageId)
Sets the In-Reply-To of the message. |
void |
setMessageId(String messageId)
Sets the Message-ID of the message. |
void |
setReplyToAddress(String address)
Sets the reply to field of the message. |
void |
setSubject(String subject)
Sets the subject of the message. |
void |
setToAddresses(String addresses)
Sets the to addresses of the message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String EMAIL_ATTRIBUTE_NAME
public static final String EMAIL_ATTRIBUTE_VALUE
public static final String MAIL_FROM
public static final String MAIL_TO
public static final String MAIL_CC
public static final String MAIL_REPLYTO
public static final String MAIL_DATE
public static final String MAIL_SUBJECT
public static final String MAIL_MESSAGE_ID
public static final String MAIL_IN_REPLY_TO
public static final String MAIL_CONTENT_TYPE
public static final String MAIL_DATE_OBJECT
public static final String MAIL_PART_IDENTIFIER
public static final String MAIL_PREFERRED_CONTENT_TYPE
public static final String MAIL_HTML_CONTENT_TYPE
Constructor Detail |
public EmailMessageEntityHelper(Entity message) throws DataManagerException
public EmailMessageEntityHelper() throws DataManagerException
Method Detail |
public Object get(String key)
public void replaceStringAttribute(String name, String value) throws DataManagerException
name
with the
value value
. If no such attribute yet exists, creates one.
DataManagerException
public String getFromAddress() throws DataManagerException
From:
field of the message.
DataManagerException
public void setFromAddress(String address) throws DataManagerException
DataManagerException
public String getToAddresses() throws DataManagerException
To:
field of the message.
FIXME: This should probably return a List of addresses instead of just a
string.
DataManagerException
public void setToAddresses(String addresses) throws DataManagerException
DataManagerException
public String getCcAddresses() throws DataManagerException
Cc:
field of the message.
FIXME: This should probably return a List of addresses instead of just a
string.
DataManagerException
public void setCcAddresses(String addresses) throws DataManagerException
DataManagerException
public String getReplyToAddress() throws DataManagerException
DataManagerException
public void setReplyToAddress(String address) throws DataManagerException
DataManagerException
public String getDateString() throws DataManagerException
Date:
field of the message.
DataManagerException
public void setDateString(String date) throws DataManagerException
DataManagerException
public Date getDateObject()
public void setDateObject(Date date) throws DataManagerException
DataManagerException
public String getSubject() throws DataManagerException
DataManagerException
public void setSubject(String subject) throws DataManagerException
DataManagerException
public String getMessageId() throws DataManagerException
DataManagerException
public void setMessageId(String messageId) throws DataManagerException
DataManagerException
public String getInReplyTo() throws DataManagerException
DataManagerException
public void setInReplyTo(String messageId) throws DataManagerException
DataManagerException
public String getContentType() throws DataManagerException
Content-Type:
field
of the message, or "text/plain" if no Content-Type:
header
is found. Anything following the initial content type declaration (e.g.
'; charset="iso-8859-1"'), and all leading and trailing whitespace is
stripped.
DataManagerException
public void setContentType(String contentType) throws DataManagerException
DataManagerException
public String getBody() throws DataManagerException
DataManagerException
public void setBody(String body) throws DataManagerException
DataManagerException
public Entity getMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |