ITemplateEngine

public interface ITemplateEngine

Represents a template engine that transforms template and data pair into resulting output (usually HTML).

Methods

MethodDescription
addTemplate(String key, String template, System.Type modelType)Adds the template to the template collection.
compile(String key, Object model)Transforms the template with the given key and model object to output.

addTemplate(String key, String template, System.Type modelType)

public abstract void addTemplate(String key, String template, System.Type modelType)

Adds the template to the template collection.

Parameters:

ParameterTypeDescription
keyjava.lang.StringKey for the template in the template collection.
templatejava.lang.StringTemplate content.
modelTypecom.aspose.ms.System.TypeType of a model object for the template.

compile(String key, Object model)

public abstract String compile(String key, Object model)

Transforms the template with the given key and model object to output.

Parameters:

ParameterTypeDescription
keyjava.lang.StringKey for the template in the template collection.
modeljava.lang.ObjectModel object with data for transformation.

Returns: java.lang.String - Resulting output as a String.