public class TemplateRenderer extends Object
MessageFormat
but in contrast can be shared between threads
because it is immutable. Parameters are denoted by a question mark directly followed by the parameter index.
The following example should illustrate the usage.
new TemplateRenderer("?1 limit ?2")
.start(context)
.addArgument(1)
.addArgument(2)
.build();
Modifier and Type | Class | Description |
---|---|---|
static class |
TemplateRenderer.Context |
A context for a template renderer that supports binding function arguments or plain strings as values for placeholders.
|
Constructor | Description |
---|---|
TemplateRenderer(String template) |
Creates a new template renderer from the given template.
|
Modifier and Type | Method | Description |
---|---|---|
TemplateRenderer.Context |
start(FunctionRenderContext context) |
Starts a new context for the given FunctionRenderContext for building parameter bindings.
|
public TemplateRenderer(String template)
template
- The template on which this renderer is based.public TemplateRenderer.Context start(FunctionRenderContext context)
context
- The render context for the functionCopyright © 2014–2018 Blazebit. All rights reserved.