public class KeepMustacheHelper
extends java.lang.Object
Helper class that allows to apply a Mustache template on a vert.x JsonObject or JsonArray. The output is sent back to a Stream, or can be retrieved as a String Use as KeepMustacheHelper = new KeepMustacheHelper() // ONE of the three .templateResource(“/path to template”) .templateString(“full {{template}}” .templateReader(Reader) .execute(JsonObject,OutputStream) // or .execute(JsonObject) // Get the String
Constructor and Description |
---|
KeepMustacheHelper() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
execute(io.vertx.core.json.JsonObject source) |
KeepMustacheHelper |
execute(io.vertx.core.json.JsonObject source,
java.io.OutputStream out) |
KeepMustacheHelper |
templateReader(java.io.Reader template)
Sets the Reader to be used to read the template Resets the mustache compiled template
|
KeepMustacheHelper |
templateResource(java.lang.String template)
Sets the “filename” of a resource to be loaded from classpath Resets the mustache compiled template
|
KeepMustacheHelper |
templateString(java.lang.String template)
Sets the "template to the content of the String Resets the mustache compiled template
|
public java.lang.String execute(io.vertx.core.json.JsonObject source)
source
- public KeepMustacheHelper execute(io.vertx.core.json.JsonObject source, java.io.OutputStream out)
source
- A JsonObject to be translatedout
- OutputStream where to write the result topublic KeepMustacheHelper templateReader(java.io.Reader template)
Sets the Reader to be used to read the template Resets the mustache compiled template
template
- public KeepMustacheHelper templateResource(java.lang.String template)
Sets the “filename” of a resource to be loaded from classpath Resets the mustache compiled template
template
- public KeepMustacheHelper templateString(java.lang.String template)
Sets the "template to the content of the String Resets the mustache compiled template
template
-