io.vertx.ext.web.common.template

## Interface TemplateEngine

- All Known Subinterfaces:
    FreeMarkerTemplateEngine, FreeMarkerTemplateEngine, HandlebarsTemplateEngine, HandlebarsTemplateEngine, JadeTemplateEngine, JadeTemplateEngine, MVELTemplateEngine, MVELTemplateEngine, PebbleTemplateEngine, PebbleTemplateEngine, RockerTemplateEngine, RockerTemplateEngine, TemplateEngine, ThymeleafTemplateEngine, ThymeleafTemplateEngine
  All Known Implementing Classes:
    CachingTemplateEngine, CachingTemplateEngine

      public interface TemplateEngine

  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.

  Author:
    Tim Fox

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isCachingEnabled()` Returns true if the template template caches template files.
    `default void` | `render(JsonObject context, String templateFileName, Handler<AsyncResult<Buffer>> handler)` Render the template.
    `void` | `render(Map<String,Object> context, String templateFileName, Handler<AsyncResult<Buffer>> handler)` Render the template.

- - ### Method Detail

    - #### render

          default void render(JsonObject context,
                              String templateFileName,
                              Handler<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 context
        `templateFileName` - the template file name to use
        `handler` - the handler that will be called with a result containing the buffer or a failure.

    - #### render

          void render(Map<String,Object> context,
                      String templateFileName,
                      Handler<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 context
        `templateFileName` - the template file name to use
        `handler` - the handler that will be called with a result containing the buffer or a failure.

    - #### isCachingEnabled

          boolean isCachingEnabled()

      Returns true if the template template caches template files. If false, then template files are freshly loaded each time they are used.
      Returns:
        True if template files are cached; otherwise, false.

Copyright © 2020 Eclipse. All rights reserved.