Class MustacheEngine


  • @Deprecated
    public final class MustacheEngine
    extends Object
    Deprecated.
    Nashorn will be removed after jdk 11, so nashorn engine ill be removed in the next major version.
    Nashorn engine that can be used to render Mustache rendering.
    • Constructor Detail

      • MustacheEngine

        public MustacheEngine​(MustacheTemplateLoader templateLoader)
        Deprecated.
        Build nashorn engine with default mustache js implementation. Mustache file will be searched into classpath: - First, try to locate webjars. - Then, try to locate into bower_components directory. - Finally, try to locate into "generic" directory ("vendors" or "js" directories). If everything fail, an exception will be thrown.
        Parameters:
        templateLoader - Template loader, used to resolve partials.
        Throws:
        MustacheIOException - If everything fail.
      • MustacheEngine

        public MustacheEngine​(MustacheTemplateLoader templateLoader,
                              String mustacheJs)
        Deprecated.
        Build nashorn engine with default mustache js implementation. Mustache file is given as a second parameter and is resolved against classpath.
        Parameters:
        templateLoader - Template loader, used to resolve partials.
        mustacheJs - Mustache JavaScript file (as InputStream instance).
        Throws:
        MustacheIOException - If script does not exist.
      • MustacheEngine

        public MustacheEngine​(MustacheTemplateLoader templateLoader,
                              InputStream mustacheJs)
        Deprecated.
        Build nashorn engine with default mustache js implementation. Mustache file is given as a second parameter and is resolved against classpath.
        Parameters:
        templateLoader - Template loader, used to resolve partials.
        mustacheJs - Mustache JavaScript file (as InputStream instance).
        Throws:
        MustacheIOException - If script does not exist.
    • Method Detail

      • render

        public String render​(String template,
                             Map<String,​Object> model)
        Deprecated.
        Render template with given model object.
        Parameters:
        template - Template.
        model - Model object.
        Returns:
        Rendered template.
      • equals

        public boolean equals​(Object o)
        Deprecated.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Deprecated.
        Overrides:
        hashCode in class Object