48 if (data instanceof Map) {
56 String key = theme.getName() +
"/" + templateName;
57 template =
cache.get(key);
58 if (
template == null) {
60 if (
cache.putIfAbsent(key,
template) != null) {
61 template =
cache.get(key);
68 Writer out =
new StringWriter();
69 template.process(data, out);
70 return out.toString();
71 }
catch (Exception e) {
72 throw new FreeMarkerException(
"Failed to process template " + templateName, e);
final KeycloakSanitizerMethod kcSanitizeMethod
Definition: FreeMarkerUtil.java:39
Template getTemplate(String templateName, Theme theme)
Definition: FreeMarkerUtil.java:76
ConcurrentHashMap< String, Template > cache
Definition: FreeMarkerUtil.java:38