Holger's
Java API

com.antelmann.net.mail
Class TableCustomizer

java.lang.Object
  extended by com.antelmann.net.mail.TableCustomizer
All Implemented Interfaces:
EmailCustomizer
Direct Known Subclasses:
TableModelCustomizer

public class TableCustomizer
extends Object
implements EmailCustomizer

uses a map to customize emails. The key of the main map is the email address and the corresponding value is a map containing all properties for the given address.

Author:
Holger Antelmann

Field Summary
protected  Map<String,Map<String,String>> map
           
 
Constructor Summary
TableCustomizer(Map<String,Map<String,String>> map)
           
 
Method Summary
 TableModel createTableModel()
           
protected  void customizeReplacement(Email email, javax.mail.internet.InternetAddress address, Map<String,String> params)
          used to customize the replacement.
 String[] getAddresses()
           
 javax.mail.internet.InternetAddress[] getInternetAddresses()
           
 void individualizeEmail(Email email, javax.mail.internet.InternetAddress address)
          this method is called by the EmailAccount.send() method to individualize the body of an email given the address.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected Map<String,Map<String,String>> map
Constructor Detail

TableCustomizer

public TableCustomizer(Map<String,Map<String,String>> map)
Method Detail

individualizeEmail

public void individualizeEmail(Email email,
                               javax.mail.internet.InternetAddress address)
                        throws javax.mail.MessagingException
Description copied from interface: EmailCustomizer
this method is called by the EmailAccount.send() method to individualize the body of an email given the address.

Specified by:
individualizeEmail in interface EmailCustomizer
Throws:
javax.mail.MessagingException
See Also:
EmailAccount.sendEmails(Email, InternetAddress[], EmailCustomizer, Monitor)

customizeReplacement

protected void customizeReplacement(Email email,
                                    javax.mail.internet.InternetAddress address,
                                    Map<String,String> params)
used to customize the replacement. This implementation follows this rule: All existing occurrences of ${key} will be replaced with the value retrieved from the props parameter. The props map will be filled with the row data for the given address, with the column name as the key and the cell data as value. If more sophisticated decision-making is required to construct the email message, this method can simply be overwritten.


getAddresses

public String[] getAddresses()

getInternetAddresses

public javax.mail.internet.InternetAddress[] getInternetAddresses()
                                                           throws javax.mail.internet.AddressException
Throws:
javax.mail.internet.AddressException

createTableModel

public TableModel createTableModel()


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads