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()
           
 boolean individualizeEmail(Email email, javax.mail.internet.InternetAddress address)
          this method is called by the EmailAccount.send() method to individualize this particular email for 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 boolean individualizeEmail(Email email,
                                  javax.mail.internet.InternetAddress address)
                           throws DatabaseException
Description copied from interface: EmailCustomizer
this method is called by the EmailAccount.send() method to individualize this particular email for given the address.

Specified by:
individualizeEmail in interface EmailCustomizer
Returns:
true only if the email is to be actually sent; false otherwise (in which case the given email to this address will be skipped)
Throws:
DatabaseException - if something went wrong when trying to access relevant data for the customization
See Also:
POP3Account.sendEmails(Email, InternetAddress[], EmailCustomizer, com.antelmann.util.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) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads