Class AbstractGenerator
java.lang.Object
org.tentackle.buildsupport.codegen.AbstractGenerator
Base class for FreeMarker-based code generators.
Holds the template directory and creates a FreeMarker Configuration with the settings shared by all
Tentackle generators. Used by the build-time plugins (e.g. the SQL, wizard and jlink Maven plugins).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfreemarker.template.ConfigurationCreates the FreeMarker configuration.Gets the FreeMarker template directory.voidsetTemplateDirectory(File templateDirectory) Sets the FreeMarker template directory.
-
Constructor Details
-
AbstractGenerator
public AbstractGenerator()
-
-
Method Details
-
getTemplateDirectory
Gets the FreeMarker template directory.- Returns:
- the template directory
-
setTemplateDirectory
Sets the FreeMarker template directory.- Parameters:
templateDirectory- the template directory, null if templates are loaded otherwise
-
createFreemarkerConfiguration
Creates the FreeMarker configuration.The configuration loads the templates from the template directory (if set), reads them as UTF-8 and rethrows template exceptions instead of logging them, wrapping unchecked exceptions.
- Returns:
- the config
- Throws:
IOException- if there's some trouble with the template directory
-