Class HandlebarsCompiler
- java.lang.Object
-
- com.github.mjeanroy.springmvc.view.mustache.core.AbstractMustacheCompiler
-
- com.github.mjeanroy.springmvc.view.mustache.handlebars.HandlebarsCompiler
-
- All Implemented Interfaces:
MustacheCompiler
public final class HandlebarsCompiler extends AbstractMustacheCompiler implements MustacheCompiler
Mustache compiler using Java Handlebar as real implementation.
-
-
Field Summary
-
Fields inherited from class com.github.mjeanroy.springmvc.view.mustache.core.AbstractMustacheCompiler
templateLoader
-
-
Constructor Summary
Constructors Constructor Description HandlebarsCompiler(com.github.jknack.handlebars.Handlebars handlebars, MustacheTemplateLoader templateLoader)
Build new mustache compiler using Handlebars API.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MustacheTemplate
doCompile(String name)
Process template compilation.boolean
equals(Object o)
int
hashCode()
String
toString()
-
Methods inherited from class com.github.mjeanroy.springmvc.view.mustache.core.AbstractMustacheCompiler
addTemporaryPartialAliases, compile, getPrefix, getSuffix, removeTemporaryPartialAliases, setPrefix, setSuffix
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.github.mjeanroy.springmvc.view.mustache.MustacheCompiler
addTemporaryPartialAliases, compile, getPrefix, getSuffix, removeTemporaryPartialAliases, setPrefix, setSuffix
-
-
-
-
Constructor Detail
-
HandlebarsCompiler
public HandlebarsCompiler(com.github.jknack.handlebars.Handlebars handlebars, MustacheTemplateLoader templateLoader)
Build new mustache compiler using Handlebars API. This compiler need aHandlebars
to produce compiled template and aMustacheTemplateLoader
to load partials defined in templates.- Parameters:
handlebars
- Handlebars Compiler (must not be null).templateLoader
- Template Loader (must not be null).
-
-
Method Detail
-
doCompile
protected MustacheTemplate doCompile(String name) throws Exception
Description copied from class:AbstractMustacheCompiler
Process template compilation. This methods should rethrows exception since it will be catches later (and a newMustacheCompilationException
will be thrown).- Specified by:
doCompile
in classAbstractMustacheCompiler
- Parameters:
name
- Template name.- Returns:
- Mustache template.
- Throws:
Exception
- If something bad happens (will be catched and rethrows).
-
-