Class TemplateEngine
- java.lang.Object
-
- io.vertx.mutiny.ext.web.common.template.TemplateEngine
-
- io.vertx.mutiny.ext.web.templ.TemplateEngine
-
public class TemplateEngine extends TemplateEngine
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 theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static io.smallrye.mutiny.vertx.TypeArg<TemplateEngine>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description TemplateEngine(io.vertx.ext.web.templ.TemplateEngine delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
io.vertx.ext.web.templ.TemplateEngine
getDelegate()
int
hashCode()
boolean
isCachingEnabled()
static TemplateEngine
newInstance(io.vertx.ext.web.templ.TemplateEngine arg)
io.smallrye.mutiny.Uni<Buffer>
render(RoutingContext context, String templateFileName)
Deprecated.io.smallrye.mutiny.Uni<Buffer>
render(RoutingContext context, String templateDirectory, String templateFileName)
Deprecated.Buffer
renderAndAwait(RoutingContext context, String templateFileName)
Deprecated.Buffer
renderAndAwait(RoutingContext context, String templateDirectory, String templateFileName)
Deprecated.String
toString()
-
Methods inherited from class io.vertx.mutiny.ext.web.common.template.TemplateEngine
newInstance, render, render, renderAndAwait, renderAndAwait
-
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.smallrye.mutiny.vertx.TypeArg<TemplateEngine> __TYPE_ARG
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.templ.TemplateEngine getDelegate()
- Overrides:
getDelegate
in classTemplateEngine
-
toString
public String toString()
- Overrides:
toString
in classTemplateEngine
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classTemplateEngine
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classTemplateEngine
-
render
@Deprecated public io.smallrye.mutiny.Uni<Buffer> render(RoutingContext context, String templateFileName)
Deprecated.Render the templateUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
context
- the routing contexttemplateFileName
- the template file name to use- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
renderAndAwait
@Deprecated public Buffer renderAndAwait(RoutingContext context, String templateFileName)
Deprecated.Blocking variant ofrender(io.vertx.mutiny.ext.web.RoutingContext,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
context
- the routing contexttemplateFileName
- the template file name to use- Returns:
- the Buffer instance produced by the operation
-
render
@Deprecated public io.smallrye.mutiny.Uni<Buffer> render(RoutingContext context, String templateDirectory, String templateFileName)
Deprecated.Render the templateNOTE if you call method directly (i.e. not using
TemplateHandler
) make sure that templateFileName is sanitized viaUnlike the bare Vert.x variant, this method returns a
Uni
. Don't forget to subscribe on it to trigger the operation.- Parameters:
context
- the routing contexttemplateDirectory
- the template directory to usetemplateFileName
- the relative template file name to use- Returns:
- the
uni
firing the result of the operation when completed, or a failure if the operation failed.
-
renderAndAwait
@Deprecated public Buffer renderAndAwait(RoutingContext context, String templateDirectory, String templateFileName)
Deprecated.Blocking variant ofrender(io.vertx.mutiny.ext.web.RoutingContext,String,String)
.This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
context
- the routing contexttemplateDirectory
- the template directory to usetemplateFileName
- the relative template file name to use- Returns:
- the Buffer instance produced by the operation
-
isCachingEnabled
public boolean isCachingEnabled()
- Overrides:
isCachingEnabled
in classTemplateEngine
- Returns:
- True if template files are cached; otherwise, false.
-
newInstance
public static TemplateEngine newInstance(io.vertx.ext.web.templ.TemplateEngine arg)
-
-