io.vertx.rxjava.ext.web.common.template

## Class TemplateEngine

- java.lang.Object
- - io.vertx.rxjava.ext.web.common.template.TemplateEngine

- Direct Known Subclasses:
    FreeMarkerTemplateEngine, HandlebarsTemplateEngine, JadeTemplateEngine, MVELTemplateEngine, PebbleTemplateEngine, RockerTemplateEngine, TemplateEngine, 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 the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<TemplateEngine>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TemplateEngine(TemplateEngine delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `TemplateEngine` | `getDelegate()`
    `int` | `hashCode()`
    `boolean` | `isCachingEnabled()` Returns true if the template template caches template files.
    `static TemplateEngine` | `newInstance(TemplateEngine arg)`
    `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.
    `Observable<Buffer>` | `renderObservable(JsonObject context, String templateFileName)` Deprecated. use `rxRender(io.vertx.core.json.JsonObject, java.lang.String)` instead
    `Observable<Buffer>` | `renderObservable(Map<String,Object> context, String templateFileName)` Deprecated. use `rxRender(io.vertx.core.json.JsonObject, java.lang.String)` instead
    `Single<Buffer>` | `rxRender(JsonObject context, String templateFileName)` Render the template.
    `Single<Buffer>` | `rxRender(Map<String,Object> context, String templateFileName)` Render the template.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<TemplateEngine> __TYPE_ARG

  - ### Constructor Detail

    - #### TemplateEngine

          public TemplateEngine(TemplateEngine delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public TemplateEngine getDelegate()

    - #### render

          public 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.

    - #### renderObservable

          @Deprecated
          public Observable<Buffer> renderObservable(JsonObject context,
                                                                 String templateFileName)

      Deprecated. use `rxRender(io.vertx.core.json.JsonObject, java.lang.String)` instead
      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
      Returns:

    - #### rxRender

          public Single<Buffer> rxRender(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 context
        `templateFileName` - the template file name to use
      Returns:

    - #### isCachingEnabled

          public 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.

    - #### render

          public 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.

    - #### renderObservable

          @Deprecated
          public Observable<Buffer> renderObservable(Map<String,Object> context,
                                                                 String templateFileName)

      Deprecated. use `rxRender(io.vertx.core.json.JsonObject, java.lang.String)` instead
      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
      Returns:

    - #### rxRender

          public 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 context
        `templateFileName` - the template file name to use
      Returns:

    - #### newInstance

          public static TemplateEngine newInstance(TemplateEngine arg)

Copyright © 2019 Eclipse. All rights reserved.