toolbox.services.mail.simple.beans
Class MailMessage

Package class diagram package MailMessage
java.lang.Object
  extended by toolbox.services.mail.simple.beans.MailMessage
All Implemented Interfaces:
java.io.Serializable, DaoBean

public class MailMessage
extends java.lang.Object
implements DaoBean, java.io.Serializable

Java Bean representing an e-mail messages.

MailMessage bean generated by the Toolbox Bean Generator.

This bean implements the DaoBean interface that allows it to be persisted by sub-class instances of the toolbox.services.dao.DaoService class.

See Also:
Serialized Form

Constructor Summary
MailMessage()
          Default constructor to initialise the internal Map for storing bean properties.
 
Method Summary
static MailMessage create(java.util.Map map)
          Create a new MailMessage bean instance using the properties in the given Map as the values of the bean properties.
 java.util.List getAttachmentURLs()
          Return the attachmentURLs property.
 java.util.List getBcc()
          Return the bcc property.
 java.lang.String getBody()
          Return the body property.
 java.util.List getCc()
          Return the cc property.
 java.lang.String getContentType()
          Return the contentType property.
 java.lang.String getFrom()
          Return the from property.
 java.util.Map getMap()
          Return the Map containing the bean properties.
 java.lang.String getMapping(java.lang.String prop)
          Return the mapped value for the provided property name.
 java.util.Map getMappings()
          Return the Map containing the property mappings.
 java.util.List getReplyTo()
          Return the replyTo property.
 java.lang.String getSubject()
          Return the subject property.
 java.util.List getTo()
          Return the to property.
 void setAttachmentURLs(java.util.List attachmentURLs)
          Set the attachmentURLs property.
 void setBcc(java.util.List bcc)
          Set the bcc property.
 void setBody(java.lang.String body)
          Set the body property.
 void setCc(java.util.List cc)
          Set the cc property.
 void setContentType(java.lang.String contentType)
          Set the contentType property.
 void setFrom(java.lang.String from)
          Set the from property.
 void setMap(java.util.Map map)
          Set the Map containing the bean properties.
 void setReplyTo(java.util.List replyTo)
          Set the replyTo property.
 void setSubject(java.lang.String subject)
          Set the subject property.
 void setTo(java.util.List to)
          Set the to property.
 java.lang.String toString()
          Return a String representation of this DaoBean instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailMessage

public MailMessage()
Default constructor to initialise the internal Map for storing bean properties.

Method Detail

setFrom

public void setFrom(java.lang.String from)
Set the from property.

Parameters:
from - New value of the from property.

getFrom

public java.lang.String getFrom()
Return the from property.

Returns:
String containinig the value of the from property.

setReplyTo

public void setReplyTo(java.util.List replyTo)
Set the replyTo property.

Parameters:
replyTo - New value of the replyTo property.

getReplyTo

public java.util.List getReplyTo()
Return the replyTo property.

Returns:
List containinig the value of the replyTo property.

setTo

public void setTo(java.util.List to)
Set the to property.

Parameters:
to - New value of the to property.

getTo

public java.util.List getTo()
Return the to property.

Returns:
List containinig the value of the to property.

setCc

public void setCc(java.util.List cc)
Set the cc property.

Parameters:
cc - New value of the cc property.

getCc

public java.util.List getCc()
Return the cc property.

Returns:
List containinig the value of the cc property.

setBcc

public void setBcc(java.util.List bcc)
Set the bcc property.

Parameters:
bcc - New value of the bcc property.

getBcc

public java.util.List getBcc()
Return the bcc property.

Returns:
List containinig the value of the bcc property.

setSubject

public void setSubject(java.lang.String subject)
Set the subject property.

Parameters:
subject - New value of the subject property.

getSubject

public java.lang.String getSubject()
Return the subject property.

Returns:
String containinig the value of the subject property.

setContentType

public void setContentType(java.lang.String contentType)
Set the contentType property.

Parameters:
contentType - New value of the contentType property.

getContentType

public java.lang.String getContentType()
Return the contentType property.

Returns:
String containinig the value of the contentType property.

setBody

public void setBody(java.lang.String body)
Set the body property.

Parameters:
body - New value of the body property.

getBody

public java.lang.String getBody()
Return the body property.

Returns:
String containinig the value of the body property.

setAttachmentURLs

public void setAttachmentURLs(java.util.List attachmentURLs)
Set the attachmentURLs property.

Parameters:
attachmentURLs - New value of the attachmentURLs property.

getAttachmentURLs

public java.util.List getAttachmentURLs()
Return the attachmentURLs property.

Returns:
List containinig the value of the attachmentURLs property.

setMap

public void setMap(java.util.Map map)
Set the Map containing the bean properties.

Specified by:
setMap in interface DaoBean
Parameters:
map - Map containing bean properties.

getMap

public java.util.Map getMap()
Return the Map containing the bean properties.

Specified by:
getMap in interface DaoBean
Returns:
Map containing bean properties.

getMapping

public java.lang.String getMapping(java.lang.String prop)
Return the mapped value for the provided property name.

Specified by:
getMapping in interface DaoBean
Parameters:
prop - Return the mapping for this property.
Returns:
String containing the mapping for the provided property.

getMappings

public java.util.Map getMappings()
Return the Map containing the property mappings.

Specified by:
getMappings in interface DaoBean
Returns:
Map instance containing property mappings.

create

public static MailMessage create(java.util.Map map)
                          throws java.lang.Exception
Create a new MailMessage bean instance using the properties in the given Map as the values of the bean properties.

Property mappings are done using Java Reflection and is performed as follows:

The keys in the Map are used as the names of the bean properties. If the Map contains a key with the value name it will be translated into a method call that will invoke the setName(...) method on the target bean using the value associated with the key in the Map.

Parameters:
map - Map containing bean properties.
Returns:
MailMessage bean instance.
Throws:
java.lang.Exception - if the bean cannot be created.

toString

public java.lang.String toString()
Return a String representation of this DaoBean instance.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the properties of this bean.