public interface TemplatingEngine
HTML page to render.| Modifier and Type | Method and Description |
|---|---|
String |
createPlaceholder(String variable)
Creates a placeholder using the current templating engine
implementation.
|
String |
evaluate(String content,
JsonObject jsonObject)
Evaluates the content, using the given parameters.
|
String |
evaluate(String content,
JsonObject jsonObject,
Locale locale)
Evaluates the content, using the given parameters.
|
String |
evaluate(String content,
Map<String,Object> params)
Evaluates the content, using the given parameters.
|
String |
evaluate(String content,
Map<String,Object> params,
Locale locale)
Evaluates the content, using the given parameters.
|
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
JsonObject jsonObject)
Evaluates a template using the parameters specified
as a
JsonObject. |
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
JsonObject jsonObject,
Locale locale)
Evaluates a template using the parameters specified
as a
JsonObject. |
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params)
Evaluates a template using the given parameters.
|
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params,
Locale locale)
Evaluates a template using the given parameters.
|
String |
fromTemplate(String templatePath,
JsonObject jsonObject)
Evaluates a template using the parameters specified
as a
JsonObject. |
String |
fromTemplate(String templatePath,
JsonObject jsonObject,
Locale locale)
Evaluates a template using the parameters specified
as a
JsonObject. |
String |
fromTemplate(String templatePath,
Map<String,Object> params)
Evaluates a template using the given parameters.
|
String |
fromTemplate(String templatePath,
Map<String,Object> params,
Locale locale)
Evaluates a template using the given parameters.
|
String evaluate(String content, Map<String,Object> params)
String evaluate(String content, Map<String,Object> params, Locale locale)
String evaluate(String content, JsonObject jsonObject)
JsonObject.
Uses the default Locale.String evaluate(String content, JsonObject jsonObject, Locale locale)
JsonObject.
Uses the specified Locale.String fromTemplate(String templatePath, Map<String,Object> params)
templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, Map<String,Object> params, Locale locale)
templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, JsonObject jsonObject)
JsonObject.
Uses the default Locale.templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, JsonObject jsonObject, Locale locale)
JsonObject.
Uses the specified Locale.templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, boolean isClasspathPath, Map<String,Object> params)
isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.String fromTemplate(String templatePath, boolean isClasspathPath, Map<String,Object> params, Locale locale)
isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.String fromTemplate(String templatePath, boolean isClasspathPath, JsonObject jsonObject)
JsonObject.
Uses the default Locale.isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.String fromTemplate(String templatePath, boolean isClasspathPath, JsonObject jsonObject, Locale locale)
JsonObject.
Uses the specified Locale.isClasspathPath - if true, the 'templatePath' is considered as
a classpath's relative path. If false, it is considered as an absolute file
system path.String createPlaceholder(String variable)
This is mainly useful for the tests, which don't know in advance which templating engine will be used, so which syntax to use for the placeholders.
For example, using Pebble, a call to createPlaceholder("name") will
result in "{{name}}" (without the quotes).
Copyright © 2018. All rights reserved.