public interface Mustache extends Identified
Modifier and Type | Method and Description |
---|---|
String |
getName()
A name is used to locate the template contents by means of
TemplateLocator . |
void |
render(Appendable appendable,
Object data)
Render the template.
|
String |
render(Object data)
Render the template.
|
getGeneratedId
String getName()
TemplateLocator
. 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)
.
Identified.getGeneratedId()
String render(Object data)
data
- Optional context object (ideally immutable), may be
null
void render(Appendable appendable, Object data)
Watch 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.
appendable
- The appendable to append the rendered template todata
- Optional context object (ideally immutable), may be
null
Copyright © 2017. All rights reserved.