public class CompilerFacade extends Object implements CompilersConfiguration
Modifier and Type | Field and Description |
---|---|
protected java.util.function.Supplier<Compilers> |
compilers |
protected java.util.function.Supplier<HandlebarsCompiler> |
handlebars |
protected Resources |
resources |
protected java.util.function.Supplier<ViewCompiler> |
viewCompiler |
Constructor and Description |
---|
CompilerFacade(Env env,
Resources resources) |
Modifier and Type | Method and Description |
---|---|
void |
addHandlebarsResolver(com.github.jknack.handlebars.ValueResolver resolver) |
boolean |
canCompile(String extension) |
CacheEntry |
compile(java.nio.file.Path path) |
CacheEntry |
compile(SourceFile sourceFile) |
String |
compiledExtension(String extension) |
void |
configureHandlebars(java.util.function.Consumer<com.github.jknack.handlebars.Handlebars> action) |
Set<String> |
extensionsThatCompileTo(String extension) |
java.nio.file.Path |
findPublicSourceFor(String uri) |
String |
handlebar(String template,
Map<String,?> variables) |
void |
registerCompiler(java.util.function.Supplier<Compiler> compilerFactory,
String compiledExtension,
String sourceExtension) |
String |
renderView(String uri,
Map<String,?> variables) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addHandlebarsHelpers, addHandlebarsHelpers
protected final Resources resources
protected final java.util.function.Supplier<Compilers> compilers
protected final java.util.function.Supplier<HandlebarsCompiler> handlebars
protected final java.util.function.Supplier<ViewCompiler> viewCompiler
public void registerCompiler(java.util.function.Supplier<Compiler> compilerFactory, String compiledExtension, String sourceExtension)
registerCompiler
in interface CompilersConfiguration
public void configureHandlebars(java.util.function.Consumer<com.github.jknack.handlebars.Handlebars> action)
configureHandlebars
in interface CompilersConfiguration
public void addHandlebarsResolver(com.github.jknack.handlebars.ValueResolver resolver)
addHandlebarsResolver
in interface CompilersConfiguration
public boolean canCompile(String extension)
public CacheEntry compile(java.nio.file.Path path) throws IOException
IOException
public CacheEntry compile(SourceFile sourceFile) throws IOException
IOException
public String handlebar(String template, Map<String,?> variables) throws IOException
IOException
public java.nio.file.Path findPublicSourceFor(String uri)
Copyright © 2015. All Rights Reserved.