|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.openexchange.mail.json.parser.MessageParser
public final class MessageParser
MessageParser - Parses instances of JSONObject to instances of MailMessage.
parseBasics(JSONObject, MailMessage, TimeZone)| Method Summary | |
|---|---|
static javax.mail.internet.InternetAddress[] |
getFromField(org.json.JSONObject jo)
Parses "From" field out of passed JSON object. |
static void |
parse(org.json.JSONObject jsonObj,
MailMessage mail,
com.openexchange.session.Session session,
int accountId)
Parses given instance of JSONObject to given instance of MailMessage. |
static void |
parse(org.json.JSONObject jsonObj,
MailMessage mail,
java.util.TimeZone timeZone,
com.openexchange.session.Session session,
int accountId)
Parses given instance of JSONObject to given instance of MailMessage. |
static ComposedMailMessage |
parse4Draft(org.json.JSONObject jsonObj,
com.openexchange.groupware.upload.impl.UploadEvent uploadEvent,
com.openexchange.session.Session session,
int accountId)
Completely parses given instance of JSONObject and given instance of UploadEvent to a corresponding
ComposedMailMessage object dedicated for being saved as a draft message. |
static ComposedMailMessage[] |
parse4Transport(org.json.JSONObject jsonObj,
com.openexchange.groupware.upload.impl.UploadEvent uploadEvent,
com.openexchange.session.Session session,
int accountId,
java.lang.String protocol,
java.lang.String hostName)
Completely parses given instance of JSONObject and given instance of UploadEvent to corresponding
ComposedMailMessage objects dedicated for being sent. |
static javax.mail.internet.InternetAddress[] |
parseAddressKey(java.lang.String key,
org.json.JSONObject jo)
Parses address field out of passed JSON object. |
static javax.mail.internet.InternetAddress[] |
parseAddressKey(java.lang.String key,
org.json.JSONObject jo,
boolean failOnError)
Parses address field out of passed JSON object. |
static void |
parseBasics(org.json.JSONObject jsonObj,
MailMessage mail,
java.util.TimeZone timeZone)
Takes a mail as jsonObj and extracts the values into a given MailMessage object. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ComposedMailMessage parse4Draft(org.json.JSONObject jsonObj,
com.openexchange.groupware.upload.impl.UploadEvent uploadEvent,
com.openexchange.session.Session session,
int accountId)
throws MailException
JSONObject and given instance of UploadEvent to a corresponding
ComposedMailMessage object dedicated for being saved as a draft message. Moreover the user's quota limitations are
considered.
jsonObj - The JSON objectuploadEvent - The upload event containing the uploaded files to attachsession - The sessionaccountId - The account ID
ComposedMailMessage
MailException - If parsing fails
public static ComposedMailMessage[] parse4Transport(org.json.JSONObject jsonObj,
com.openexchange.groupware.upload.impl.UploadEvent uploadEvent,
com.openexchange.session.Session session,
int accountId,
java.lang.String protocol,
java.lang.String hostName)
throws MailException
JSONObject and given instance of UploadEvent to corresponding
ComposedMailMessage objects dedicated for being sent. Moreover the user's quota limitations are considered.
jsonObj - The JSON objectuploadEvent - The upload event containing the uploaded files to attachsession - The sessionaccountId - The account IDprotocol - The server's protocolhostname - The server's host name
ComposedMailMessage
MailException - If parsing fails
public static void parse(org.json.JSONObject jsonObj,
MailMessage mail,
com.openexchange.session.Session session,
int accountId)
throws MailException
JSONObject to given instance of MailMessage. Moreover the user's quota limitations are
considered.
jsonObj - The JSON object (source)mail - The mail(target), which should be emptysession - The sessionaccountId - The account ID
MailException - If parsing fails
public static void parse(org.json.JSONObject jsonObj,
MailMessage mail,
java.util.TimeZone timeZone,
com.openexchange.session.Session session,
int accountId)
throws MailException
JSONObject to given instance of MailMessage. Moreover the user's quota limitations are
considered.
jsonObj - The JSON object (source)mail - The mail(target), which should be emptytimeZone - The user time zonesession - The sessionaccountId - The account ID
MailException - If parsing fails
public static void parseBasics(org.json.JSONObject jsonObj,
MailMessage mail,
java.util.TimeZone timeZone)
throws org.json.JSONException,
javax.mail.internet.AddressException,
MailException
jsonObj - mail - timeZone -
org.json.JSONException
javax.mail.internet.AddressException
MailException
public static javax.mail.internet.InternetAddress[] getFromField(org.json.JSONObject jo)
throws javax.mail.internet.AddressException,
org.json.JSONException
jo - The JSON object
javax.mail.internet.AddressException - If parsing the address fails
org.json.JSONException - If a JSON error occurred
public static javax.mail.internet.InternetAddress[] parseAddressKey(java.lang.String key,
org.json.JSONObject jo)
throws org.json.JSONException,
javax.mail.internet.AddressException
key - The key of the address fieldjo - The JSON object
org.json.JSONException - If a JSON error occurred
javax.mail.internet.AddressException - If parsing an address fails
public static javax.mail.internet.InternetAddress[] parseAddressKey(java.lang.String key,
org.json.JSONObject jo,
boolean failOnError)
throws org.json.JSONException,
javax.mail.internet.AddressException
key - The key of the address fieldjo - The JSON object
org.json.JSONException - If a JSON error occurred
javax.mail.internet.AddressException - If parsing an address fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||