|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.json.writer.MessageWriter
public final class MessageWriter
MessageWriter - Writes MailMessage instances as JSON strings
| Nested Class Summary | |
|---|---|
static interface |
MessageWriter.MailFieldWriter
|
| Method Summary | |
|---|---|
static long |
addUserTimezone(long time,
java.util.TimeZone timeZone)
Adds the user time zone offset to given date time |
static org.json.JSONArray |
getAddressesAsArray(javax.mail.internet.InternetAddress[] addrs)
Convert an array of InternetAddress instances into a JSON-Array conforming to:
[["The Personal", "someone@somewhere.com"], ...] |
static MessageWriter.MailFieldWriter[] |
getMailFieldWriter(MailListField[] fields)
Generates appropriate field writers for given mail fields |
static org.json.JSONObject |
writeMailMessage(int accountId,
MailMessage mail,
DisplayMode displayMode,
com.openexchange.session.Session session,
UserSettingMail settings)
Writes whole mail as a JSON object. |
static org.json.JSONObject |
writeRawMailMessage(int accountId,
MailMessage mail)
Writes raw mail as a JSON object. |
static org.json.JSONObject |
writeStructure(int accountId,
MailMessage mail,
long maxSize)
Writes specified mail's structure as a JSON object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static org.json.JSONObject writeStructure(int accountId,
MailMessage mail,
long maxSize)
throws MailException
accountId - The mail's account IDmail - The mail to writemaxSize - The allowed max. size
MailException - If writing structure fails
public static org.json.JSONObject writeMailMessage(int accountId,
MailMessage mail,
DisplayMode displayMode,
com.openexchange.session.Session session,
UserSettingMail settings)
throws MailException
accountId - The account IDmail - The mail to writedisplayMode - The display modesession - The sessionsettings - The user's mail settings used for writing message; if null the settings are going to be fetched from
storage, thus no request-specific preparations will take place.
MailException - If writing message fails
public static org.json.JSONObject writeRawMailMessage(int accountId,
MailMessage mail)
throws MailException
accountId - The account IDmail - The mail to write
MailException - If writing message failspublic static MessageWriter.MailFieldWriter[] getMailFieldWriter(MailListField[] fields)
fields - The mail fields to write
MessageWriter.MailFieldWriter
public static long addUserTimezone(long time,
java.util.TimeZone timeZone)
time - The date timetimeZone - The time zone
public static org.json.JSONArray getAddressesAsArray(javax.mail.internet.InternetAddress[] addrs)
InternetAddress instances into a JSON-Array conforming to:
[["The Personal", "someone@somewhere.com"], ...]
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||