public interface TextTemplateScript
Modifier and Type | Method and Description |
---|---|
TextTemplateModel |
getModel()
The backing model for this template.
|
java.lang.String |
html(java.lang.Object value)
Escapes the toString() value of the given object, by way of
HtmlEscapers . |
java.lang.String |
render(java.util.Map<java.lang.String,?> model,
java.lang.String templateName)
Renders a nested template inline, with the given model merged with the current template model.
|
java.lang.String |
render(java.lang.String templateName)
Renders a nested template inline, using the same model as this template.
|
java.lang.String |
urlParam(java.lang.Object value)
Escapes the toString() value of the given object, by way of
UrlEscapers.urlFormParameterEscaper() . |
java.lang.String |
urlPathSegment(java.lang.Object value)
Escapes the toString() value of the given object, by way of
UrlEscapers.urlPathSegmentEscaper() . |
TextTemplateModel getModel()
java.lang.String render(java.lang.String templateName) throws java.lang.Exception
templateName
- The name of the template to renderjava.lang.Exception
- if an error occurs compiling/executing the templaterender(java.util.Map, String)
java.lang.String render(java.util.Map<java.lang.String,?> model, java.lang.String templateName) throws java.lang.Exception
The nested template will be rendered directly to the underlying buffer; it is not returned from this method.
This method returns an empty string so that it can be used in situations where the return value would have been
included in the output (e.g. a <?= ?>
block).
The template name is resolved into a template using the same renderer that initiated rendering of this template.
model
- The model to merge with the current template modeltemplateName
- The name of the template to renderjava.lang.Exception
- if an error occurs compiling/executing the templatejava.lang.String html(java.lang.Object value)
HtmlEscapers
.value
- the value to escapejava.lang.String urlParam(java.lang.Object value)
UrlEscapers.urlFormParameterEscaper()
.value
- the value to escapejava.lang.String urlPathSegment(java.lang.Object value)
UrlEscapers.urlPathSegmentEscaper()
.value
- the value to escape