Class FreemarkerUtils
- java.lang.Object
-
- pl.edu.icm.unity.engine.api.utils.FreemarkerUtils
-
public class FreemarkerUtils extends Object
Helper with shared routings for bootstraping template engine.- Author:
- K. Benedyczak
-
-
Field Summary
Fields Modifier and Type Field Description static String
TEMPLATES_ROOT
-
Constructor Summary
Constructors Constructor Description FreemarkerUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static freemarker.cache.TemplateLoader
getTemplateLoader(String webContentsDirectory, String templatesRoot, Class<?> fallbackResourceLoaderClass)
static String
processStringTemplate(Map<String,Object> datamodel, String templateStr)
static void
processTemplate(freemarker.template.Configuration cfg, String view, Map<String,String> datamodel, Writer out)
static boolean
validateStringTemplate(String templateStr)
-
-
-
Field Detail
-
TEMPLATES_ROOT
public static final String TEMPLATES_ROOT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getTemplateLoader
public static freemarker.cache.TemplateLoader getTemplateLoader(String webContentsDirectory, String templatesRoot, Class<?> fallbackResourceLoaderClass)
-
processTemplate
public static void processTemplate(freemarker.template.Configuration cfg, String view, Map<String,String> datamodel, Writer out) throws IOException
- Throws:
IOException
-
processStringTemplate
public static String processStringTemplate(Map<String,Object> datamodel, String templateStr)
-
validateStringTemplate
public static boolean validateStringTemplate(String templateStr)
-
-