com.uwyn.rife.mail
Class Email

java.lang.Object
  extended by com.uwyn.rife.site.Validation<ConstrainedBean,ConstrainedProperty>
      extended by com.uwyn.rife.mail.Email
All Implemented Interfaces:
Constrained<ConstrainedBean,ConstrainedProperty>, ConstrainedPropertyListener, Validated, ValidatedConstrained<ConstrainedProperty>, Cloneable

public class Email
extends Validation<ConstrainedBean,ConstrainedProperty>

Contains the details of an email message that will be sent through the mail queue.

Since:
1.0
Version:
$Revision: 3634 $
Author:
Geert Bevin (gbevin[remove] at uwyn dot com)

Constructor Summary
Email()
          Creates a new instance.
 
Method Summary
protected  void activateValidation()
          This method is called at least once and maximum once when any method related to Validated rules, subjects and group or Constrained properties are used.
 void addBcc(String bccAddress)
          Adds a bcc email address.
 void addCc(String ccAddress)
          Adds a cc email address.
 void addTo(String toAddress)
          Adds a to email address.
 Email bcc(String bccAddress)
          Adds a bcc email address.
 Email bccAddresses(String bccAddresses)
          Sets the bcc email addresses.
 Email body(String body)
          Sets the body.
 Email cc(String ccAddress)
          Adds a cc email address.
 Email ccAddresses(String ccAddresses)
          Sets the cc email addresses.
 boolean equals(Object other)
           
 Email from(String from)
          Sets the from email address.
 String getBccAddresses()
          Retrieves the bcc email addresses.
 String getBody()
          Retrieves the body.
 String getCcAddresses()
          Retrieves the cc email addresses.
 String getFromAddress()
          Retrieves the from email address.
 int getId()
          Retrieves the id of this instance.
 boolean getQueueFlag()
          Retrieves the queue flag, this is only for internal use.
 String getSubject()
          Retrieves the subject.
 String getToAddresses()
          Retrieves the to email addresses.
 int hashCode()
           
 Email id(int id)
          Sets the id.
 void setBccAddresses(String bccAddresses)
          Sets the bcc email addresses.
 void setBody(String body)
          Sets the body.
 void setCcAddresses(String ccAddresses)
          Sets the cc email addresses.
 void setFromAddress(String from)
          Sets the from email address.
 void setId(int id)
          Sets the id of this instance.
 void setQueueFlag(boolean queueFlag)
          Sets the queue flag, this is only for internal use.
 void setSubject(String subject)
          Sets the subject .
 void setToAddresses(String toAddresses)
          Sets the to email addresses.
 Email subject(String subject)
          Sets the subject.
 Email to(String toAddress)
          Adds a to email address.
 Email toAddresses(String toAddresses)
          Sets the to email addresses.
 String toString()
           
 
Methods inherited from class com.uwyn.rife.site.Validation
addConstrainedPropertyRules, addConstraint, addConstraint, addGroup, addRule, addValidationError, clone, constraintSet, countValidationErrors, focusGroup, generateConstrainedPropertyRules, getConstrainedBean, getConstrainedProperties, getConstrainedProperty, getErrorIndication, getGroup, getGroups, getLoadingErrors, getRules, getValidatedSubjects, getValidationErrors, hasPropertyConstraint, isSubjectValid, limitSubjectErrors, makeErrorValid, makeSubjectValid, provideValidatedBean, replaceValidationErrors, resetGroup, resetValidation, retrieveValidatedBean, unlimitSubjectErrors, validate, validate, validateGroup, validateGroup
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Email

public Email()
Creates a new instance.

Since:
1.0
Method Detail

activateValidation

protected void activateValidation()
Description copied from class: Validation
This method is called at least once and maximum once when any method related to Validated rules, subjects and group or Constrained properties are used.

By overriding this method, you can thus isolate all the validation setup code code and don't enforce a performance penalty at each object construction when doing it in the default constructor.

Overrides:
activateValidation in class Validation<ConstrainedBean,ConstrainedProperty>

id

public Email id(int id)
Sets the id.

Parameters:
id - the id
Returns:
the Email instance

setId

public void setId(int id)
Sets the id of this instance.

Parameters:
id - the id

getId

public int getId()
Retrieves the id of this instance.

Returns:
the requested id

from

public Email from(String from)
Sets the from email address.

Parameters:
from - an email address
Returns:
the Email instance

setFromAddress

public void setFromAddress(String from)
Sets the from email address.

Parameters:
from - an email address

getFromAddress

public String getFromAddress()
Retrieves the from email address.

Returns:
a String

to

public Email to(String toAddress)
Adds a to email address.

Parameters:
toAddress - an email address
Returns:
the Email instance

addTo

public void addTo(String toAddress)
Adds a to email address.

Parameters:
toAddress - an email address

toAddresses

public Email toAddresses(String toAddresses)
Sets the to email addresses. This replaces all previous ones.

The email addresses need to be separated by commas.

Parameters:
toAddresses - the email addresses, separated by commas
Returns:
the Email instance

setToAddresses

public void setToAddresses(String toAddresses)
Sets the to email addresses. This replaces all previous ones.

The email addresses need to be separated by commas.

Parameters:
toAddresses - the email addresses, separated by commas

getToAddresses

public String getToAddresses()
Retrieves the to email addresses.

Returns:
the to email addresses, separated by commas

subject

public Email subject(String subject)
Sets the subject.

Parameters:
subject - the subject
Returns:
the Email instance

setSubject

public void setSubject(String subject)
Sets the subject .

Parameters:
subject - the subject

getSubject

public String getSubject()
Retrieves the subject.

Returns:
the subject

body

public Email body(String body)
Sets the body.

Parameters:
body - the body
Returns:
the Email instance

setBody

public void setBody(String body)
Sets the body.

Parameters:
body - the body

getBody

public String getBody()
Retrieves the body.

Returns:
the body

cc

public Email cc(String ccAddress)
Adds a cc email address.

Parameters:
ccAddress - an email address
Returns:
the Email instance

addCc

public void addCc(String ccAddress)
Adds a cc email address.

Parameters:
ccAddress - an email address

ccAddresses

public Email ccAddresses(String ccAddresses)
Sets the cc email addresses. This replaces all previous ones.

The email addresses need to be separated by commas.

Parameters:
ccAddresses - the email addresses, separated by commas
Returns:
the Email instance

setCcAddresses

public void setCcAddresses(String ccAddresses)
Sets the cc email addresses. This replaces all previous ones.

The email addresses need to be separated by commas.

Parameters:
ccAddresses - the email addresses, separated by commas

getCcAddresses

public String getCcAddresses()
Retrieves the cc email addresses.

Returns:
the cc email addresses, separated by commas

bcc

public Email bcc(String bccAddress)
Adds a bcc email address.

Parameters:
bccAddress - an email address
Returns:
the Email instance

addBcc

public void addBcc(String bccAddress)
Adds a bcc email address.

Parameters:
bccAddress - an email address

bccAddresses

public Email bccAddresses(String bccAddresses)
Sets the bcc email addresses. This replaces all previous ones.

The email addresses need to be separated by commas.

Parameters:
bccAddresses - the email addresses, separated by commas
Returns:
the Email instance

setBccAddresses

public void setBccAddresses(String bccAddresses)
Sets the bcc email addresses. This replaces all previous ones.

The email addresses need to be separated by commas.

Parameters:
bccAddresses - the email addresses, separated by commas

getBccAddresses

public String getBccAddresses()
Retrieves the bcc email addresses.

Returns:
the bcc email addresses, separated by commas

getQueueFlag

public boolean getQueueFlag()
Retrieves the queue flag, this is only for internal use.

Returns:
true if the message is queued; and

false otherwise


setQueueFlag

public void setQueueFlag(boolean queueFlag)
Sets the queue flag, this is only for internal use.

Parameters:
queueFlag - the queue flag

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.