TemplateEngine

Inheritance: java.lang.Object

public final class TemplateEngine

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

Constructors

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

Methods

MethodDescription
equals(Object arg0)
getClass()
getTemplateFields()Get list of template field names.
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:

ParameterTypeDescription
fileNamejava.lang.StringName of the file.

TemplateEngine(MailMessage templateMessage)

public TemplateEngine(MailMessage templateMessage)

Initializes a new instance of the TemplateEngine class.

Parameters:

ParameterTypeDescription
templateMessageMailMessageThe template message.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getTemplateFields()

public final System.Collections.Generic.IGenericEnumerable<String> getTemplateFields()

Get list of template field names.

Returns: com.aspose.ms.System.Collections.Generic.IGenericEnumerable<java.lang.String> - List of template field names.

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:

ParameterTypeDescription
rowsDataRowCollectionThe 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:

ParameterTypeDescription
rowsDataRowCollectionThe DataRowCollection, which contains the source data to instantiate the template.
mappingsDataColumnMappingCollectionThe 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:

ParameterTypeDescription
tableDataTableThe 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:

ParameterTypeDescription
tableDataTableThe DataTable, which contains the source data to instantiate the template.
mappingsDataColumnMappingCollectionThe 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:

ParameterTypeDescription
readerIDataReaderThe 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:

ParameterTypeDescription
namejava.lang.StringThe 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:

ParameterTypeDescription
rowDataRowThe 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:

ParameterTypeDescription
sourceMailMessageThe 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:

ParameterTypeDescription
namejava.lang.StringThe name of the funciton.
routineTemplateRoutineDelegate 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:

ParameterTypeDescription
namejava.lang.StringThe 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:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int