io.vertx.rxjava.ext.web.templ

## Class TemplateEngine

- java.lang.Object
- - io.vertx.rxjava.ext.web.templ.TemplateEngine

- Direct Known Subclasses:
    FreeMarkerTemplateEngine, HandlebarsTemplateEngine, JadeTemplateEngine, MVELTemplateEngine, PebbleTemplateEngine, ThymeleafTemplateEngine

      public class TemplateEngine
      extends Object

  A template engine 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 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
    --- | ---
    `TemplateEngine` | `getDelegate()`
    `boolean` | `isCachingEnabled()` Returns true if the template engine caches template files.
    `static TemplateEngine` | `newInstance(TemplateEngine arg)`
    `void` | `render(RoutingContext context, String templateFileName, Handler<AsyncResult<Buffer>> handler)` Render the template
    `void` | `render(RoutingContext context, String templateDirectory, String templateFileName, Handler<AsyncResult<Buffer>> handler)` Render the template
    `rx.Observable<Buffer>` | `renderObservable(RoutingContext context, String templateFileName)` Deprecated. use `rxRender(io.vertx.rxjava.ext.web.RoutingContext, java.lang.String)` instead
    `rx.Observable<Buffer>` | `renderObservable(RoutingContext context, String templateDirectory, String templateFileName)` Deprecated. use `rxRender(io.vertx.rxjava.ext.web.RoutingContext, java.lang.String)` instead
    `rx.Single<Buffer>` | `rxRender(RoutingContext context, String templateFileName)` Render the template
    `rx.Single<Buffer>` | `rxRender(RoutingContext context, String templateDirectory, String templateFileName)` Render the template

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final TypeArg<TemplateEngine> __TYPE_ARG

  - ### Constructor Detail

    - #### TemplateEngine

          public TemplateEngine(TemplateEngine delegate)

  - ### Method Detail

    - #### getDelegate

          public TemplateEngine getDelegate()

    - #### render

          public void render(RoutingContext context,
                             String templateFileName,
                             Handler<AsyncResult<Buffer>> handler)

      Render the template
      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 rx.Observable<Buffer> renderObservable(RoutingContext context,
                                                                    String templateFileName)

      Deprecated. use `rxRender(io.vertx.rxjava.ext.web.RoutingContext, java.lang.String)` instead
      Render the template
      Parameters:
        `context` - the routing context
        `templateFileName` - the template file name to use
      Returns:

    - #### rxRender

          public rx.Single<Buffer> rxRender(RoutingContext context,
                                            String templateFileName)

      Render the template
      Parameters:
        `context` - the routing context
        `templateFileName` - the template file name to use
      Returns:

    - #### render

          public void render(RoutingContext context,
                             String templateDirectory,
                             String templateFileName,
                             Handler<AsyncResult<Buffer>> handler)

      Render the template

      NOTE if you call method directly (i.e. not using `TemplateHandler`) make sure that templateFileName is sanitized via `io.vertx.rxjava.ext.web.impl.Utils#normalizePath`

      Parameters:
        `context` - the routing context
        `templateDirectory` - the template directory to use
        `templateFileName` - the relative template file name to use
        `handler` - the handler that will be called with a result containing the buffer or a failure.

    - #### renderObservable

          @Deprecated
          public rx.Observable<Buffer> renderObservable(RoutingContext context,
                                                                    String templateDirectory,
                                                                    String templateFileName)

      Deprecated. use `rxRender(io.vertx.rxjava.ext.web.RoutingContext, java.lang.String)` instead
      Render the template

      NOTE if you call method directly (i.e. not using `TemplateHandler`) make sure that templateFileName is sanitized via `io.vertx.rxjava.ext.web.impl.Utils#normalizePath`

      Parameters:
        `context` - the routing context
        `templateDirectory` - the template directory to use
        `templateFileName` - the relative template file name to use
      Returns:

    - #### rxRender

          public rx.Single<Buffer> rxRender(RoutingContext context,
                                            String templateDirectory,
                                            String templateFileName)

      Render the template

      NOTE if you call method directly (i.e. not using `TemplateHandler`) make sure that templateFileName is sanitized via `io.vertx.rxjava.ext.web.impl.Utils#normalizePath`

      Parameters:
        `context` - the routing context
        `templateDirectory` - the template directory to use
        `templateFileName` - the relative template file name to use
      Returns:

    - #### isCachingEnabled

          public boolean isCachingEnabled()

      Returns true if the template engine 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.

    - #### newInstance

          public static TemplateEngine newInstance(TemplateEngine arg)

Copyright © 2017. All rights reserved.