org.sf.codejen.freemarker
Class FreeMarkerTemplate

java.lang.Object
  extended by org.sf.codejen.TemplateAdapter
      extended by org.sf.codejen.DefaultTemplate
          extended by org.sf.codejen.freemarker.FreeMarkerTemplate
All Implemented Interfaces:
Template

public class FreeMarkerTemplate
extends DefaultTemplate

Implementation of Template using FreeMarker as the template engine.

Complusory attributes:

Optional attributes:


Field Summary
 
Fields inherited from class org.sf.codejen.DefaultTemplate
fileNameGenerator, generatedFiles, modelExtractor, postProcessors
 
Constructor Summary
FreeMarkerTemplate()
           
 
Method Summary
 boolean apply(Object model)
          Applies the data model to the template.
 void setCanOverwrite(boolean canOverwrite)
           
 void setModelName(String modelName)
           
 void setOutputDir(String outputDir)
           
 void setOutputFile(String outputFile)
           
 void setTemplateDir(String dir)
           
 void setTemplateFile(String file)
           
 
Methods inherited from class org.sf.codejen.DefaultTemplate
addPostProcessor, getGeneratedFileList, setFileNameGenerator, setModelExtractor
 
Methods inherited from class org.sf.codejen.TemplateAdapter
getName, isUndoable, undo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreeMarkerTemplate

public FreeMarkerTemplate()
Method Detail

apply

public boolean apply(Object model)
              throws TemplateException
Description copied from interface: Template
Applies the data model to the template.

Specified by:
apply in interface Template
Overrides:
apply in class TemplateAdapter
Returns:
false when nothing can be generated; otherwise true.
Throws:
TemplateException - if any error is encoutered during the code generation. Code Generator should use Throwable.getCause() to access the wrapped exception.

setTemplateFile

public void setTemplateFile(String file)

setTemplateDir

public void setTemplateDir(String dir)

setModelName

public void setModelName(String modelName)

setOutputDir

public void setOutputDir(String outputDir)

setOutputFile

public void setOutputFile(String outputFile)

setCanOverwrite

public void setCanOverwrite(boolean canOverwrite)