public interface TemplatingRequestContextAddon<R extends RequestContext<?>>
| Modifier and Type | Method and Description |
|---|---|
void |
addTemplatingGlobalVariable(String key,
Object value)
Adds a global variable that will be available to any following
evaluation by the templating engine.
|
void |
addTemplatingGlobalVariables(Map<String,Object> variables)
Adds global variables that will be available to any following
evaluation by the templating engine.
|
String |
createPlaceholder(String variable)
Creates a placeholder using the current templating engine
implementation.
|
void |
deleteAllTemplatingGlobalVariables()
Deletes all global templating variables.
|
void |
deleteTemplatingGlobalVariable(String key)
Deletes a global templating variable.
|
String |
evaluate(String content,
JsonObject model)
Evaluates some content using the given parameters.
|
String |
evaluate(String content,
JsonObject model,
Locale locale)
Evaluates some content using the given parameters.
|
String |
evaluate(String content,
Map<String,Object> params)
Evaluates some content using the given parameters.
|
String |
evaluate(String content,
Map<String,Object> params,
Locale locale)
Evaluates some content using the given parameters.
|
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
JsonObject model)
Renders a template using the given parameters.
|
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
JsonObject model,
Locale locale)
Renders a template usgin the given parameters.
|
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params)
Renders a template using the given parameters.
|
String |
fromTemplate(String templatePath,
boolean isClasspathPath,
Map<String,Object> params,
Locale locale)
Renders a template usgin the given parameters.
|
String |
fromTemplate(String templatePath,
JsonObject model)
Renders a template using the given parameters.
|
String |
fromTemplate(String templatePath,
JsonObject model,
Locale locale)
Renders a template usgin the given parameters.
|
String |
fromTemplate(String templatePath,
Map<String,Object> params)
Renders a template using the given parameters.
|
String |
fromTemplate(String templatePath,
Map<String,Object> params,
Locale locale)
Renders a template usgin the given parameters.
|
Map<String,Object> |
getSpincastReservedMap()
Gets the Map reserved for Spincast usage to put some
global templating variables.
|
Object |
getTemplatingGlobalVariable(String key)
Gets a global templating variable.
|
Map<String,Object> |
getTemplatingGlobalVariables()
The global templating variables.
|
void addTemplatingGlobalVariable(String key, Object value)
void addTemplatingGlobalVariables(Map<String,Object> variables)
Map<String,Object> getTemplatingGlobalVariables()
Object getTemplatingGlobalVariable(String key)
void deleteAllTemplatingGlobalVariables()
void deleteTemplatingGlobalVariable(String key)
String evaluate(String content, Map<String,Object> params)
Locale found by the LocaleResolver.String evaluate(String content, Map<String,Object> params, Locale locale)
Locale.String fromTemplate(String templatePath, Map<String,Object> params)
Locale found by the LocaleResolver.templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, Map<String,Object> params, Locale locale)
Locale specified.templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, boolean isClasspathPath, Map<String,Object> params)
Locale found by the LocaleResolver.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)
Locale specified.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 evaluate(String content, JsonObject model)
Locale found by the LocaleResolver.String evaluate(String content, JsonObject model, Locale locale)
Locale.String fromTemplate(String templatePath, JsonObject model)
Locale found by the LocaleResolver.templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, JsonObject model, Locale locale)
Locale specified.templatePath - must be a classpath's relative path.String fromTemplate(String templatePath, boolean isClasspathPath, JsonObject model)
Locale found by the LocaleResolver.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 model, Locale locale)
Locale specified.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 © 2017. All rights reserved.