A core FreeMarker API that represents a compiled template. Typically, you will use a {@link Configuration} object to instantiate a template.
Configuration cfg = new Configuration(); ... Template myTemplate = cfg.getTemplate("myTemplate.html");
However, you can also construct a template directly by passing in to the appropriate constructor a java.io.Reader instance that is set to read the raw template text. The compiled template is stored in an an efficient data structure for later use.
To render the template, i.e. to merge it with a data model, and thus produce "cooked" output, call the process method.
Any error messages from exceptions thrown during compilation will be included in the output stream and thrown back to the calling code. To change this behavior, you can install custom exception handlers using {@link Configurable#setTemplateExceptionHandler(TemplateExceptionHandler)} ona Configuration object (for all templates belonging to a configuration) or on a Template object (for a single template).
It's not legal to modify the values of FreeMarker settings: a) while the template is executing; b) if the template object is already accessible from multiple threads. @version $Id: Template.java,v 1.216.2.3 2006/03/10 17:49:02 revusky Exp $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|