|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TemplateEngine
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.
| Method Summary | |
|---|---|
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. |
| Method Detail |
|---|
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||