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 MutinyDelegate, io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
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 using Vert.x codegen.

  • Field Details

    • __TYPE_ARG

      public static final TypeArg<TemplateHandler> __TYPE_ARG
    • 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:
  • Constructor Details

    • TemplateHandler

      public TemplateHandler(io.vertx.ext.web.handler.TemplateHandler delegate)
    • TemplateHandler

      public TemplateHandler(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.handler.TemplateHandler getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • 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
    • handle

      public void handle(RoutingContext arg0)
      Specified by:
      handle in interface io.vertx.core.Handler<RoutingContext>
    • setIndexTemplate

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

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

      public static TemplateHandler create(TemplateEngine engine, String templateDirectory, String contentType)
      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
    • accept

      public void accept(RoutingContext item)
      Specified by:
      accept in interface Consumer<RoutingContext>
    • newInstance

      public static TemplateHandler newInstance(io.vertx.ext.web.handler.TemplateHandler arg)