@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 Object implements ViewsRenderer
Modifier and Type | Field and Description |
---|---|
protected String |
folder |
protected com.github.jknack.handlebars.Handlebars |
handlebars |
protected HandlebarsViewsRendererConfiguration |
handlebarsViewsRendererConfiguration |
protected ResourceLoader |
resourceLoader |
protected ViewsConfiguration |
viewsConfiguration |
EXTENSION_SEPARATOR, FILE_SEPARATOR
Constructor and Description |
---|
HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration,
ClassPathResourceLoader resourceLoader,
HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration)
Deprecated.
|
HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration,
ClassPathResourceLoader resourceLoader,
HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration,
com.github.jknack.handlebars.Handlebars handlebars) |
Modifier and Type | Method and Description |
---|---|
boolean |
exists(String viewName) |
Writable |
render(String viewName,
Object data) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
modelOf, normalizeFile, normalizeFolder, render
protected final ViewsConfiguration viewsConfiguration
protected final ResourceLoader resourceLoader
protected HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration
protected com.github.jknack.handlebars.Handlebars handlebars
protected String folder
@Deprecated public HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration, ClassPathResourceLoader resourceLoader, HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration)
viewsConfiguration
- Views ConfigurationresourceLoader
- Resource LoaderhandlebarsViewsRendererConfiguration
- Handlebars ViewRenderer Configuration.@Inject public HandlebarsViewsRenderer(ViewsConfiguration viewsConfiguration, ClassPathResourceLoader resourceLoader, HandlebarsViewsRendererConfiguration handlebarsViewsRendererConfiguration, com.github.jknack.handlebars.Handlebars handlebars)
viewsConfiguration
- Views ConfigurationresourceLoader
- Resource LoaderhandlebarsViewsRendererConfiguration
- Handlebars ViewRenderer Configuration.handlebars
- Handlebars Engine@Nonnull public Writable render(@Nonnull String viewName, @Nullable Object data)
render
in interface ViewsRenderer
viewName
- view name to be renderdata
- response body to render it with a viewpublic boolean exists(@Nonnull String viewName)
exists
in interface ViewsRenderer
viewName
- view name to be render