public interface TemplateEngine
Concrete implementations exist for several well-known template engines.
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clears any internal caches used by this engine.
|
default Future<Buffer> |
render(JsonObject context,
String templateFileName) |
default void |
render(JsonObject context,
String templateFileName,
Handler<AsyncResult<Buffer>> handler)
Render the template.
|
default Future<Buffer> |
render(Map<String,Object> context,
String templateFileName) |
void |
render(Map<String,Object> context,
String templateFileName,
Handler<AsyncResult<Buffer>> handler)
Render the template.
|
default <T> T |
unwrap()
Returns the underlying engine, so further configurations or customizations may be applied.
|
default void render(JsonObject context, String templateFileName, Handler<AsyncResult<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 Future<Buffer> render(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, Handler<AsyncResult<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 Future<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.void clearCache()
Copyright © 2023 Eclipse. All rights reserved.