@Produces(value="text/html") @Requires(property="micronaut.views.handlebars.enabled",notEquals="false") @Requires(classes=com.github.jknack.handlebars.Handlebars.class) @Singleton public class HandlebarsViewsRenderer extends java.lang.Object implements ViewsRenderer
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
folder |
protected com.github.jknack.handlebars.Handlebars |
handlebars |
protected HandlebarsViewsRendererConfiguration |
handlebarsViewsRendererConfiguration |
protected io.micronaut.core.io.ResourceLoader |
resourceLoader |
protected ViewsConfiguration |
viewsConfiguration |
EXTENSION_SEPARATOR, FILE_SEPARATOR
Constructor and Description |
---|
HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration,
io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader,
HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration)
Deprecated.
|
HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration,
io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader,
HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration,
com.github.jknack.handlebars.Handlebars handlebars) |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(java.lang.String viewName) |
io.micronaut.core.io.Writable |
render(java.lang.String viewName,
java.lang.Object data) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
modelOf, normalizeFile, normalizeFolder, render
protected final ViewsConfiguration viewsConfiguration
protected final io.micronaut.core.io.ResourceLoader resourceLoader
protected HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration
protected com.github.jknack.handlebars.Handlebars handlebars
protected java.lang.String folder
@Deprecated public HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration, io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader, HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration)
viewsConfiguration
- Views ConfigurationresourceLoader
- Resource LoaderhandlebarsViewsRendererConfiguration
- Handlebars ViewRenderer Configuration.@Inject public HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration, io.micronaut.core.io.scan.ClassPathResourceLoader resourceLoader, HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration, com.github.jknack.handlebars.Handlebars handlebars)
viewsConfiguration
- Views ConfigurationresourceLoader
- Resource LoaderhandlebarsViewsRendererConfiguration
- Handlebars ViewRenderer Configuration.handlebars
- Handlebars Engine@Nonnull public io.micronaut.core.io.Writable render(@Nonnull java.lang.String viewName, @Nullable java.lang.Object data)
render
in interface ViewsRenderer
viewName
- view name to be renderdata
- response body to render it with a viewpublic boolean exists(@Nonnull java.lang.String viewName)
exists
in interface ViewsRenderer
viewName
- view name to be render