Package io.vertx.mutiny.ext.web.handler
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<TemplateHandler>static final StringThe default content type header to be used in the responsestatic final StringThe default index pagestatic final StringThe default directory where templates will be looked for -
Constructor Summary
ConstructorsConstructorDescriptionTemplateHandler(io.vertx.ext.web.handler.TemplateHandler delegate) Create a new instance ofTemplateHandlerdelegating to the given (non-null) instance ofTemplateHandler.TemplateHandler(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(RoutingContext item) Handle an item.static TemplateHandlercreate(TemplateEngine engine) Create a handlerstatic TemplateHandlercreate(TemplateEngine engine, String templateDirectory, String contentType) Create a handlerbooleanio.vertx.ext.web.handler.TemplateHandlerGet the delegate instance.voidhandle(RoutingContext item) Handle an item.inthashCode()static TemplateHandlernewInstance(io.vertx.ext.web.handler.TemplateHandler delegate) Creates a new instance of theTemplateHandler.setIndexTemplate(String indexTemplate) Set the index templatetoString()
-
Field Details
-
DEFAULT_TEMPLATE_DIRECTORY
The default directory where templates will be looked for- See Also:
-
DEFAULT_CONTENT_TYPE
The default content type header to be used in the response- See Also:
-
DEFAULT_INDEX_TEMPLATE
The default index page- See Also:
-
__TYPE_ARG
-
-
Constructor Details
-
TemplateHandler
public TemplateHandler(io.vertx.ext.web.handler.TemplateHandler delegate) Create a new instance ofTemplateHandlerdelegating to the given (non-null) instance ofTemplateHandler. -
TemplateHandler
-
-
Method Details
-
accept
Handle an item. This method is generated from theoriginalmethod."- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
handle
Handle an item. This method is generated from theoriginalmethod."- Specified by:
handlein interfaceio.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:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
setIndexTemplate
Set the index template- Parameters:
indexTemplate- the index template- Returns:
- a reference to this, so the API can be used fluently
-
create
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 enginetemplateDirectory- the template directory where templates will be looked forcontentType- the content type header to be used in the response- Returns:
- the handler
-
newInstance
Creates a new instance of theTemplateHandler. -
hashCode
public int hashCode() -
equals
-
toString
-