org.springframework.boot.autoconfigure.mustache

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 Detail

      • MustacheResourceTemplateLoader

        public MustacheResourceTemplateLoader()
      • MustacheResourceTemplateLoader

        public MustacheResourceTemplateLoader(String prefix,
                                              String suffix)
    • Method Detail

      • setCharset

        public void setCharset(String charSet)
        Set the charset.
        Parameters:
        charSet - the charset
      • getTemplate

        public Reader getTemplate(String name)
                           throws Exception
        Specified by:
        getTemplate in interface com.samskivert.mustache.Mustache.TemplateLoader
        Throws:
        Exception