1 package org.ocltf.templateengine; 2 3 import java.io.StringWriter; 4 import java.util.Map; 5 6 7 /*** 8 * The interface that all templates engines used within MDA must implement. 9 * It allows us to plug-in the template engine to use for processing 10 * of templates used by the system. 11 * 12 * @author Chad Brandon 13 */ 14 public interface TemplateEngine { 15 16 /*** 17 * Initializes the TempateEngine. 18 * 19 * @param properties any initialization properties 20 * to pass to the TemplateEngine. 21 */ 22 public void init(Map properties); 23 24 /*** 25 * Processes a template. 26 * 27 * @param templateFile the path to the template file that will be processed. 28 * @param templateObjects any additional objects we wish to make available to the 29 * translation template that is processed 30 * @param output the Writer to which to write the output of the processing. 31 * @throws Exception any exception that may occur 32 */ 33 public void processTemplate( 34 String templateFile, 35 Map templateObjects, 36 StringWriter output) throws Exception; 37 38 }