Class TemplateHelper
java.lang.Object
org.hibernate.tool.reveng.internal.export.common.TemplateHelper
Helper and wrapper for a Template engine (currently only FreeMarker).
Exposes only the essential functions to avoid too much coupling else where.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected freemarker.template.SimpleHashprotected freemarker.template.Configuration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidensureExistence(File destination) protected freemarker.template.SimpleHashvoidprotected ObjectinternalPutInContext(String key, Object value) protected ObjectvoidprocessString(String template, Writer output) voidprocessTemplate(String templateName, Writer output, String rootContext) look up the template named templateName via the paths and print the content to the outputvoidputInContext(String key, Object value) voidremoveFromContext(String key) voidbooleantemplateExists(String templateName)
-
Field Details
-
freeMarkerEngine
protected freemarker.template.Configuration freeMarkerEngine -
context
protected freemarker.template.SimpleHash context
-
-
Constructor Details
-
TemplateHelper
public TemplateHelper()
-
-
Method Details
-
init
-
getOutputDirectory
-
putInContext
-
removeFromContext
-
ensureExistence
-
getContext
protected freemarker.template.SimpleHash getContext() -
processString
-
setupContext
public void setupContext() -
internalPutInContext
-
internalRemoveFromContext
-
processTemplate
-
templateExists
-