TemplateEngine

Inheritance: java.lang.Object

public final class TemplateEngine

This class uses specified template to construct E-Mail messages.

Constructors

Constructor Description
TemplateEngine(String fileName) Initializes a new instance of the TemplateEngine class.
TemplateEngine(MailMessage templateMessage) Initializes a new instance of the TemplateEngine class.

Methods

Method Description
equals(Object arg0)
getClass()
hashCode()
instantiate(DataRowCollection rows) Instantiates the template with a DataRowCollection as datasource.
instantiate(DataRowCollection rows, DataColumnMappingCollection mappings) Instantiates the template with a DataRowCollection as datasource.
instantiate(DataTable table) Instantiates the template with a DataTable as datasource.
instantiate(DataTable table, DataColumnMappingCollection mappings) Instantiates the template with a DataTable as datasource.
instantiate(IDataReader reader) Instantiates the template with a IDataReader as datasource.
isRoutineRegistered(String name) Determines if a name of template routine is registered in the template engine.
merge(DataRow row) Merge a source DataRow with the template.
merge(MailMessage source) Merge a source MailMessage with the template
notify()
notifyAll()
registerRoutine(String name, TemplateRoutine routine) Registers the template routine to the temaplate engine.
reset() Resets this instance.
toString()
unregisterRoutine(String name) Unregister the template routine from the template engine by name.
wait()
wait(long arg0)
wait(long arg0, int arg1)

TemplateEngine(String fileName)

public TemplateEngine(String fileName)

Initializes a new instance of the TemplateEngine class.

Parameters:

Parameter Type Description
fileName java.lang.String Name of the file.

TemplateEngine(MailMessage templateMessage)

public TemplateEngine(MailMessage templateMessage)

Initializes a new instance of the TemplateEngine class.

Parameters:

Parameter Type Description
templateMessage MailMessage The template message.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

hashCode()

public native int hashCode()

Returns: int

instantiate(DataRowCollection rows)

public final MailMessageCollection instantiate(DataRowCollection rows)

Instantiates the template with a DataRowCollection as datasource.

Parameters:

Parameter Type Description
rows DataRowCollection The DataRowCollection, which contains the source data to instantiate the template.

Returns: MailMessageCollection - A MailMessageCollection that generated by the template and the datasource.

instantiate(DataRowCollection rows, DataColumnMappingCollection mappings)

public final MailMessageCollection instantiate(DataRowCollection rows, DataColumnMappingCollection mappings)

Instantiates the template with a DataRowCollection as datasource.

Parameters:

Parameter Type Description
rows DataRowCollection The DataRowCollection, which contains the source data to instantiate the template.
mappings DataColumnMappingCollection The IColumnMappingCollection, which represents the mapping between the source column in data source and target field in template

Returns: MailMessageCollection - A MailMessageCollection that generated by the template and the datasource.

instantiate(DataTable table)

public final MailMessageCollection instantiate(DataTable table)

Instantiates the template with a DataTable as datasource.

Parameters:

Parameter Type Description
table DataTable The DataTable, which contains the source data to instantiate the template.

Returns: MailMessageCollection - A MailMessageCollection that generated by the template and the datasource.

instantiate(DataTable table, DataColumnMappingCollection mappings)

public final MailMessageCollection instantiate(DataTable table, DataColumnMappingCollection mappings)

Instantiates the template with a DataTable as datasource.

Parameters:

Parameter Type Description
table DataTable The DataTable, which contains the source data to instantiate the template.
mappings DataColumnMappingCollection The IColumnMappingCollection, which represents the mapping between the source column in DataTable and target field in template

Returns: MailMessageCollection - A MailMessageCollection that generated by the template and the datasource.

instantiate(IDataReader reader)

public final MailMessageCollection instantiate(IDataReader reader)

Instantiates the template with a IDataReader as datasource.

Parameters:

Parameter Type Description
reader IDataReader The IDataReader, which will provide the source data to instantiate the template.

Returns: MailMessageCollection - A MailMessageCollection that generated by the template and the datasource.

isRoutineRegistered(String name)

public final boolean isRoutineRegistered(String name)

Determines if a name of template routine is registered in the template engine.

Parameters:

Parameter Type Description
name java.lang.String The name that is used to register the template routine.

Returns: boolean - Returns True if the name is registered in the template engine, otherwise returns False.

merge(DataRow row)

public final MailMessage merge(DataRow row)

Merge a source DataRow with the template.

Parameters:

Parameter Type Description
row DataRow The source DataRow.

Returns: MailMessage - The MailMessage merged with template.

merge(MailMessage source)

public final MailMessage merge(MailMessage source)

Merge a source MailMessage with the template

Parameters:

Parameter Type Description
source MailMessage The source MailMessage

Returns: MailMessage - The MailMessage merged with template

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

registerRoutine(String name, TemplateRoutine routine)

public final void registerRoutine(String name, TemplateRoutine routine)

Registers the template routine to the temaplate engine.

Parameters:

Parameter Type Description
name java.lang.String The name of the funciton.
routine TemplateRoutine Delegate processing the data

reset()

public final void reset()

Resets this instance.

toString()

public String toString()

Returns: java.lang.String

unregisterRoutine(String name)

public final void unregisterRoutine(String name)

Unregister the template routine from the template engine by name.

Parameters:

Parameter Type Description
name java.lang.String The name that is used to unregister the template routine.

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int