Class TemplateEngine
java.lang.Object
io.vertx.rxjava3.ext.web.common.template.TemplateEngine
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
- Direct Known Subclasses:
FreeMarkerTemplateEngine, HandlebarsTemplateEngine, MVELTemplateEngine, PebbleTemplateEngine, PugTemplateEngine, RockerTemplateEngine, ThymeleafTemplateEngine
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 the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClears any internal caches used by this engine.booleaninthashCode()static TemplateEnginerender(JsonObject context, String templateFileName) Render the template.Render the template.rxRender(JsonObject context, String templateFileName) Render the template.Render the template.toString()unwrap()Returns the underlying engine, so further configurations or customizations may be applied ornullwhen the engine cannot unwrap it.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
TemplateEngine
-
TemplateEngine
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
render
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:
- a future notified with a result containing the buffer or a failure
-
rxRender
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:
- a future notified with a result containing the buffer or a failure
-
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
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:
- a future notified with a result containing the buffer or a failure
-
rxRender
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:
- a future notified with a result containing the buffer or a failure
-
unwrap
Returns the underlying engine, so further configurations or customizations may be applied ornullwhen the engine cannot unwrap it.- Returns:
- the engine instance.
-
newInstance
-