| org.andromda.core.templateengine.TemplateEngine
All known Subclasses: org.andromda.templateengines.freemarker.FreeMarkerTemplateEngine, org.andromda.core.templateengine.MockTemplateEngine, org.andromda.templateengines.velocity.VelocityTemplateEngine,
TemplateEngine | public interface TemplateEngine (Code) | | The interface that all templates engines used within AndroMDA must implement.
It allows us to plug-in the template engine to use for processing of
templates used by the system.
author: Chad Brandon |
Method Summary | |
public void | addMacroLibrary(String macroLibrary) Adds a a macro library for use within this template engine. | public String | getEvaluatedExpression(String expression, Map templateObjects) Evaluates the expression contained within the template
being processed and returns the result.
Parameters: expression - the expression to evaluate. Parameters: templateObjects - any additional objects we wish to make availableto the template engine when the expression is evaluted. | public List | getMacroLibraries() Returns the list of macro libraries used within this template engine. | public void | initialize(String namespace) Initializes the TempateEngine.
Parameters: namespace - The name of a namespace this can be used for whatever thetemplate engine implementation likes. | public void | processTemplate(String templateFile, Map templateObjects, Writer output) Processes a template. | public void | setMergeLocation(String mergeLocation) Sets the location of merge templates. | public void | shutdown() Shuts down the template engine. |
addMacroLibrary | public void addMacroLibrary(String macroLibrary)(Code) | | Adds a a macro library for use within this template engine.
Parameters: macroLibrary - |
getEvaluatedExpression | public String getEvaluatedExpression(String expression, Map templateObjects)(Code) | | Evaluates the expression contained within the template
being processed and returns the result.
Parameters: expression - the expression to evaluate. Parameters: templateObjects - any additional objects we wish to make availableto the template engine when the expression is evaluted. It this is nullthere will be nothing to be evaluated and therefore this operation will returnnull. the result of the evaluated expression as a String. |
getMacroLibraries | public List getMacroLibraries()(Code) | | Returns the list of macro libraries used within this template engine.
List the list of macros |
initialize | public void initialize(String namespace) throws Exception(Code) | | Initializes the TempateEngine.
Parameters: namespace - The name of a namespace this can be used for whatever thetemplate engine implementation likes. For example, it can helpdetermine the name of the log file to which output is logged. |
processTemplate | public void processTemplate(String templateFile, Map templateObjects, Writer output) throws Exception(Code) | | Processes a template.
Parameters: templateFile - the path to the template file that will be processed. Parameters: templateObjects - any additional objects we wish to make availableto the translation template that is processed Parameters: output - the Writer to which to write the output of the processing. throws: Exception - any exception that may occur |
setMergeLocation | public void setMergeLocation(String mergeLocation)(Code) | | Sets the location of merge templates. These are templates
that will be merged into cartridges during processing from an external
location. This allows the ability to define templates external to plugins
so that these templates can override plugin templates in order to provide
customization.
Parameters: the - location of the merge files. |
shutdown | public void shutdown()(Code) | | Shuts down the template engine. The meaning of this is defined by the
template engine itself. At least, it should close any logfiles.
|
|
|