Class TemplateEngine
- java.lang.Object
-
- io.vertx.reactivex.ext.web.common.template.TemplateEngine
-
- Direct Known Subclasses:
FreeMarkerTemplateEngine,HandlebarsTemplateEngine,JadeTemplateEngine,MVELTemplateEngine,PebbleTemplateEngine,RockerTemplateEngine,ThymeleafTemplateEngine
public class TemplateEngine extends Object
A template template uses a specific template and the data in a routing context to render a resource into a buffer.Concrete implementations exist for several well-known template engines.
NOTE: This class has been automatically generated from theoriginalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<TemplateEngine>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description TemplateEngine(io.vertx.ext.web.common.template.TemplateEngine delegate)TemplateEngine(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()Clears any internal caches used by this engine.booleanequals(Object o)io.vertx.ext.web.common.template.TemplateEnginegetDelegate()inthashCode()static TemplateEnginenewInstance(io.vertx.ext.web.common.template.TemplateEngine arg)voidrender(io.vertx.core.json.JsonObject context, String templateFileName)Render the template.voidrender(io.vertx.core.json.JsonObject context, String templateFileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Buffer>> handler)Render the template.voidrender(Map<String,Object> context, String templateFileName)Render the template.voidrender(Map<String,Object> context, String templateFileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Buffer>> handler)Render the template.io.reactivex.Single<Buffer>rxRender(io.vertx.core.json.JsonObject context, String templateFileName)Render the template.io.reactivex.Single<Buffer>rxRender(Map<String,Object> context, String templateFileName)Render the template.StringtoString()<T> Tunwrap()Returns the underlying engine, so further configurations or customizations may be applied.
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<TemplateEngine> __TYPE_ARG
-
-
Constructor Detail
-
TemplateEngine
public TemplateEngine(io.vertx.ext.web.common.template.TemplateEngine delegate)
-
TemplateEngine
public TemplateEngine(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.common.template.TemplateEngine getDelegate()
-
render
public void render(io.vertx.core.json.JsonObject context, String templateFileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Buffer>> handler)Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".- Parameters:
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.
-
render
public void render(io.vertx.core.json.JsonObject context, String templateFileName)Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".- Parameters:
context- the routing contexttemplateFileName- the template file name to use
-
rxRender
public io.reactivex.Single<Buffer> rxRender(io.vertx.core.json.JsonObject context, String templateFileName)
Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".- Parameters:
context- the routing contexttemplateFileName- the template file name to use- Returns:
-
clearCache
public void clearCache()
Clears any internal caches used by this engine. For most engines this means clearing the vert.x cache, implementations that do not use vert.x as a cache should clear their own cache.
-
render
public void render(Map<String,Object> context, String templateFileName, io.vertx.core.Handler<io.vertx.core.AsyncResult<Buffer>> handler)
Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".- Parameters:
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.
-
render
public void render(Map<String,Object> context, String templateFileName)
Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".- Parameters:
context- the routing contexttemplateFileName- the template file name to use
-
rxRender
public io.reactivex.Single<Buffer> rxRender(Map<String,Object> context, String templateFileName)
Render the template. Template engines that support partials/fragments should extract the template base path from the template filename up to the last file separator. Some engines support localization, for these engines, there is a predefined key "lang" to specify the language to be used in the localization, the format should follow the standard locale formats e.g.: "en-gb", "pt-br", "en".- Parameters:
context- the routing contexttemplateFileName- the template file name to use- Returns:
-
unwrap
public <T> T unwrap()
Returns the underlying engine, so further configurations or customizations may be applied.- Returns:
- the engine instance.
-
newInstance
public static TemplateEngine newInstance(io.vertx.ext.web.common.template.TemplateEngine arg)
-
-