Class MustacheTemplateRenderer
java.lang.Object
io.spring.initializr.generator.io.template.MustacheTemplateRenderer
- All Implemented Interfaces:
TemplateRenderer
A
TemplateRenderer
using Mustache with a configurable resource prefix.
Templates should have an mustache
extension.- Author:
- Stephane Nicoll
-
Constructor Summary
ConstructorsConstructorDescriptionMustacheTemplateRenderer
(String resourcePrefix) Create a new instance with the resource prefix to use.MustacheTemplateRenderer
(String resourcePrefix, org.springframework.cache.Cache templateCache) Create a new instance with the resource prefix and theCache
to use. -
Method Summary
-
Constructor Details
-
MustacheTemplateRenderer
public MustacheTemplateRenderer(String resourcePrefix, org.springframework.cache.Cache templateCache) Create a new instance with the resource prefix and theCache
to use.- Parameters:
resourcePrefix
- the resource prefix to apply to locate a template based on its nametemplateCache
- the cache to use for compiled templates (can benull
to not use caching)
-
MustacheTemplateRenderer
Create a new instance with the resource prefix to use.- Parameters:
resourcePrefix
- the resource prefix to apply to locate a template based on its name- See Also:
-
-
Method Details
-
render
Description copied from interface:TemplateRenderer
Render the template with the specified name and the specified model.- Specified by:
render
in interfaceTemplateRenderer
- Parameters:
templateName
- the name of the templatemodel
- the model to use- Returns:
- the rendering result
-