com.openexchange.mail.dataobjects
Class MailStructure

java.lang.Object
  extended by com.openexchange.mail.dataobjects.MailStructure

public final class MailStructure
extends java.lang.Object

MailStructure - Represents a mail structure

Author:
Thorben Betten

Constructor Summary
MailStructure()
          Initializes a new MailStructure
MailStructure(ContentType contentType)
          Initializes a new MailStructure
 
Method Summary
 void addSubStructure(MailStructure mailStructure)
          Adds a sub-structure
 ContentType getContentType()
          Gets the content type
static MailStructure getMailStructure(MailMessage mail)
          Generates the corresponding mail structure for specified mail message.
 MailStructure[] getSubStructures()
          Gets this mail structure's sub-structures
 void setContentType(ContentType contentType)
          Sets the content type
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailStructure

public MailStructure()
Initializes a new MailStructure


MailStructure

public MailStructure(ContentType contentType)
Initializes a new MailStructure

Parameters:
contentType - The content type
Method Detail

getContentType

public ContentType getContentType()
Gets the content type

Returns:
The content type

setContentType

public void setContentType(ContentType contentType)
Sets the content type

Parameters:
contentType - The content type

addSubStructure

public void addSubStructure(MailStructure mailStructure)
Adds a sub-structure

Parameters:
mailStructure - The sub-structure to add

getSubStructures

public MailStructure[] getSubStructures()
Gets this mail structure's sub-structures

Returns:
The sub-structures

getMailStructure

public static MailStructure getMailStructure(MailMessage mail)
                                      throws MailException
Generates the corresponding mail structure for specified mail message.

Parameters:
mail - The mail message
Returns:
The corresponding mail structure
Throws:
MailException - If a mail error occurs

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object