Class MustacheResourceTemplateLoader
java.lang.Object
org.springframework.boot.autoconfigure.mustache.MustacheResourceTemplateLoader
- All Implemented Interfaces:
com.samskivert.mustache.Mustache.TemplateLoader
,Aware
,ResourceLoaderAware
public class MustacheResourceTemplateLoader
extends Object
implements com.samskivert.mustache.Mustache.TemplateLoader, ResourceLoaderAware
Mustache TemplateLoader implementation that uses a prefix, suffix and the Spring
Resource abstraction to load a template from a file, classpath, URL etc. A
Mustache.TemplateLoader
is needed in the Mustache.Compiler
when you want to render
partials (i.e. tiles-like features).- Since:
- 1.2.2
- Author:
- Dave Syer
- See Also:
-
Mustache
Resource
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetTemplate
(String name) void
setCharset
(String charSet) Set the charset.void
setResourceLoader
(ResourceLoader resourceLoader) Set the resource loader.
-
Constructor Details
-
MustacheResourceTemplateLoader
public MustacheResourceTemplateLoader() -
MustacheResourceTemplateLoader
-
-
Method Details
-
setCharset
Set the charset.- Parameters:
charSet
- the charset
-
setResourceLoader
Set the resource loader.- Specified by:
setResourceLoader
in interfaceResourceLoaderAware
- Parameters:
resourceLoader
- the resource loader
-
getTemplate
- Specified by:
getTemplate
in interfacecom.samskivert.mustache.Mustache.TemplateLoader
- Throws:
Exception
-