Class TemplateHandler

java.lang.Object
io.vertx.mutiny.ext.web.handler.TemplateHandler
All Implemented Interfaces:
MutinyDelegate, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>

public class TemplateHandler extends Object implements io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>, MutinyDelegate
A handler which renders responses using a template engine and where the template name is selected from the URI path.

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Tim Fox
See Also:
  • TemplateHandler
  • Field Details

    • DEFAULT_TEMPLATE_DIRECTORY

      public static final String DEFAULT_TEMPLATE_DIRECTORY
      The default directory where templates will be looked for
      See Also:
    • DEFAULT_CONTENT_TYPE

      public static final String DEFAULT_CONTENT_TYPE
      The default content type header to be used in the response
      See Also:
    • DEFAULT_INDEX_TEMPLATE

      public static final String DEFAULT_INDEX_TEMPLATE
      The default index page
      See Also:
    • __TYPE_ARG

      public static final TypeArg<TemplateHandler> __TYPE_ARG
  • Constructor Details

    • TemplateHandler

      public TemplateHandler(io.vertx.ext.web.handler.TemplateHandler delegate)
      Create a new instance of TemplateHandler delegating to the given (non-null) instance of TemplateHandler.
    • TemplateHandler

      public TemplateHandler(Object delegate)
  • Method Details

    • accept

      public void accept(RoutingContext item)
      Handle an item. This method is generated from the original method."
      Specified by:
      accept in interface Consumer<RoutingContext>
    • handle

      public void handle(RoutingContext item)
      Handle an item. This method is generated from the original method."
      Specified by:
      handle in interface io.vertx.core.Handler<RoutingContext>
    • getDelegate

      public io.vertx.ext.web.handler.TemplateHandler getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • setIndexTemplate

      public TemplateHandler setIndexTemplate(String indexTemplate)
      Set the index template
      Parameters:
      indexTemplate - the index template
      Returns:
      a reference to this, so the API can be used fluently
    • create

      public static TemplateHandler create(TemplateEngine engine)
      Create a handler
      Parameters:
      engine - the template engine
      Returns:
      the handler
    • create

      public static TemplateHandler create(TemplateEngine engine, String templateDirectory, String contentType)
      Create a handler
      Parameters:
      engine - the template engine
      templateDirectory - the template directory where templates will be looked for
      contentType - the content type header to be used in the response
      Returns:
      the handler
    • newInstance

      public static TemplateHandler newInstance(io.vertx.ext.web.handler.TemplateHandler delegate)
      Creates a new instance of the TemplateHandler.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object