public interface TemplateEngine
Concrete implementations exist for several well-known template engines.
Modifier and Type | Method and Description |
---|---|
default io.vertx.core.Future<io.vertx.core.buffer.Buffer> |
render(io.vertx.core.json.JsonObject context,
String templateFileName) |
default void |
render(io.vertx.core.json.JsonObject context,
String templateFileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.buffer.Buffer>> handler)
Render the template.
|
default io.vertx.core.Future<io.vertx.core.buffer.Buffer> |
render(Map<String,Object> context,
String templateFileName) |
void |
render(Map<String,Object> context,
String templateFileName,
io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.buffer.Buffer>> handler)
Render the template.
|
default <T> T |
unwrap()
Returns the underlying engine, so further configurations or customizations may be applied.
|
default void render(io.vertx.core.json.JsonObject context, String templateFileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.buffer.Buffer>> handler)
context
- the routing contexttemplateFileName
- the template file name to usehandler
- the handler that will be called with a result containing the buffer or a failure.default io.vertx.core.Future<io.vertx.core.buffer.Buffer> render(io.vertx.core.json.JsonObject context, String templateFileName)
context
- the routing contexttemplateFileName
- the template file name to userender(JsonObject, String, Handler)
void render(Map<String,Object> context, String templateFileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.core.buffer.Buffer>> handler)
context
- the routing contexttemplateFileName
- the template file name to usehandler
- the handler that will be called with a result containing the buffer or a failure.default io.vertx.core.Future<io.vertx.core.buffer.Buffer> render(Map<String,Object> context, String templateFileName)
context
- the routing contexttemplateFileName
- the template file name to userender(Map, String, Handler)
default <T> T unwrap() throws ClassCastException
T
- the engine object type.ClassCastException
- when the expected type does not match the internal type.Copyright © 2020 Eclipse. All rights reserved.