@Internal public class Template extends Object implements Mustache
| Constructor and Description |
|---|
Template(Long generatedId,
String name,
MustacheEngine engine) |
Template(Long generatedId,
String name,
MustacheEngine engine,
List<Template> nestedTemplates) |
| Modifier and Type | Method and Description |
|---|---|
MustacheEngine |
getEngine() |
Long |
getGeneratedId()
The id must be unique for the given component type and
MustacheEngine instance. |
String |
getName()
A name is used to locate the template contents by means of
TemplateLocator. |
Template |
getNestedTemplate(String name) |
RootSegment |
getRootSegment() |
void |
render(Appendable appendable,
Object data)
Render the template.
|
String |
render(Object data)
Render the template.
|
String |
toString() |
public Template(Long generatedId, String name, MustacheEngine engine)
generatedId - name - engine - public Template(Long generatedId, String name, MustacheEngine engine, List<Template> nestedTemplates)
generatedId - name - engine - nestedTemplates - public Long getGeneratedId()
IdentifiedMustacheEngine instance.getGeneratedId in interface Identifiedpublic String getName()
MustacheTemplateLocator. It's sometimes
referenced as an identifier provided by the user. In most cases, the name
represents a full (possibly virtual) path of the template.
Note that it's possible to have more than one template with the same name
for a MustacheEngine instance, due to existence
of
MustacheEngine.compileMustache(String, String).
getName in interface MustacheIdentified.getGeneratedId()public String render(Object data)
Mustachepublic void render(Appendable appendable, Object data)
MustacheWatch out! Any appendable-specific operations (e.g. stream flushing and closing) are not performed automatically.
Note that if an asynchronous helper is used the "append" operations may be delayed due to the use of an intermediate buffer.
public RootSegment getRootSegment()
public MustacheEngine getEngine()
Copyright © 2017. All rights reserved.