|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.javagen.agile.core.emitter.template.FreemarkerCodeGenerator
public class FreemarkerCodeGenerator
FreeMarker template implementation.
At the time of this release FreeMarker was a more capable and uptodate template engine than Velocity and thus the prefered template engine for JavaGen.
TODO do we need to add support for freemarker.properties configuration?
| Field Summary | |
|---|---|
protected freemarker.template.Configuration |
cfg
|
static String |
DEFAULT_TEMPLATE_LOCATION_PATH
|
protected String |
templateBasePath
|
protected WriterFactory |
writerFactory
|
| Constructor Summary | |
|---|---|
FreemarkerCodeGenerator()
|
|
| Method Summary | |
|---|---|
void |
gen(String templatePath,
File outFile,
Map<String,Object> root)
Process templates. |
protected freemarker.template.Configuration |
getConfiguration()
|
String |
getTemplateBasePath()
Base path to load templates from which can be prefixed with classpath: or file: and a path to locate the file in any context. |
WriterFactory |
getWriterFactory()
|
void |
setTemplateBasePath(String templateBasePath)
|
void |
setWriterFactory(WriterFactory writerFactory)
Provide a hook for tools to intercept the output sinks. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_TEMPLATE_LOCATION_PATH
protected String templateBasePath
protected freemarker.template.Configuration cfg
protected WriterFactory writerFactory
| Constructor Detail |
|---|
public FreemarkerCodeGenerator()
| Method Detail |
|---|
protected freemarker.template.Configuration getConfiguration()
public void gen(String templatePath,
File outFile,
Map<String,Object> root)
gen in interface TemplateGeneratortemplatePath - relative to templateBasePathoutFile - output fileroot - usualy a combined context based on current model node.public String getTemplateBasePath()
classpath: or file: and a path to locate the file in any context.
getTemplateBasePath in interface TemplateGeneratorpublic void setTemplateBasePath(String templateBasePath)
public void setWriterFactory(WriterFactory writerFactory)
TemplateGenerator
setWriterFactory in interface TemplateGeneratorpublic WriterFactory getWriterFactory()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||