com.openexchange.mail.json.writer
Class FolderWriter

java.lang.Object
  extended by com.openexchange.mail.json.writer.FolderWriter

public final class FolderWriter
extends java.lang.Object

FolderWriter - Writes MailFolder instances as JSON strings.

Author:
Thorben Betten

Nested Class Summary
static class FolderWriter.MailFolderFieldWriter
           
 
Method Summary
static FolderWriter.MailFolderFieldWriter[] getMailFolderFieldWriter(int[] fields, MailConfig mailConfig)
          Generates appropriate field writers for given mail folder fields
static org.json.JSONObject writeMailFolder(int accountId, MailFolder folder, MailConfig mailConfig)
          Writes whole folder as a JSON object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeMailFolder

public static org.json.JSONObject writeMailFolder(int accountId,
                                                  MailFolder folder,
                                                  MailConfig mailConfig)
                                           throws MailException
Writes whole folder as a JSON object

Parameters:
folder - The folder to write
Returns:
The written JSON object
Throws:
MailException

getMailFolderFieldWriter

public static FolderWriter.MailFolderFieldWriter[] getMailFolderFieldWriter(int[] fields,
                                                                            MailConfig mailConfig)
Generates appropriate field writers for given mail folder fields

Parameters:
fields - The fields to write
mailConfig - Current mail configuration
Returns:
Appropriate field writers as an array of FolderWriter.MailFolderFieldWriter