public interface TemplateEngine
Modifier and Type | Method and Description |
---|---|
void |
addMacroLibrary(String macroLibrary)
Adds a a macro library for use within this template engine.
|
String |
getEvaluatedExpression(String expression,
Map<String,Object> templateObjects)
Evaluates the
expression contained within the template
being processed and returns the result. |
List<String> |
getMacroLibraries()
Returns the list of macro libraries used within this template engine.
|
void |
initialize(String namespace)
Initializes the TempateEngine.
|
void |
processTemplate(String templateFile,
Map<String,Object> templateObjects,
Writer output)
Processes a template.
|
void |
setMergeLocation(String mergeLocation)
Sets the location of
merge templates. |
void |
shutdown()
Shuts down the template engine.
|
void initialize(String namespace) throws Exception
namespace
- The name of a namespace this can be used for whatever the
template engine implementation likes. For example, it can help
determine the name of the log file to which output is logged.Exception
void processTemplate(String templateFile, Map<String,Object> templateObjects, Writer output) throws Exception
templateFile
- the path to the template file that will be processed.templateObjects
- any additional objects we wish to make available
to the translation template that is processedoutput
- the Writer to which to write the output of the processing.Exception
- any exception that may occurvoid shutdown()
List<String> getMacroLibraries()
void addMacroLibrary(String macroLibrary)
macroLibrary
- void setMergeLocation(String mergeLocation)
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.mergeLocation
- the location of the merge files.String getEvaluatedExpression(String expression, Map<String,Object> templateObjects)
expression
contained within the template
being processed and returns the result.expression
- the expression to evaluate.templateObjects
- any additional objects we wish to make available
to the template engine when the expression is evaluated. It this is null
there will be nothing to be evaluated and therefore this operation will return
null.Copyright © 2003–2014 AndroMDA.org. All rights reserved.