public class PebbleEngine extends Object
| Constructor and Description |
|---|
PebbleEngine() |
PebbleEngine(Loader loader)
Constructor for the Pebble Engine given an instantiated Loader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(Extension extension) |
Map<String,BinaryOperator> |
getBinaryOperators() |
Locale |
getDefaultLocale() |
ExecutorService |
getExecutorService() |
<T extends Extension> |
getExtension(Class<T> clazz) |
Map<String,Filter> |
getFilters() |
Map<String,Function> |
getFunctions() |
Map<String,Object> |
getGlobalVariables() |
Lexer |
getLexer() |
Loader |
getLoader() |
List<NodeVisitor> |
getNodeVisitors() |
Parser |
getParser() |
PebbleTemplate |
getTemplate(String templateName)
Loads, parses, and compiles a template into an instance of PebbleTemplate
and returns this instance.
|
com.google.common.cache.Cache<String,PebbleTemplate> |
getTemplateCache() |
Map<String,Test> |
getTests() |
Map<String,TokenParser> |
getTokenParsers() |
Map<String,UnaryOperator> |
getUnaryOperators() |
boolean |
isStrictVariables() |
void |
setDefaultLocale(Locale locale)
The default locale that will be passed to each template upon compilation.
|
void |
setExecutorService(ExecutorService executorService)
Providing an ExecutorService will enable some advanced multithreading
features such as the parallel tag.
|
void |
setLoader(Loader loader) |
void |
setStrictVariables(boolean strictVariables)
Changes the
strictVariables setting of the PebbleEngine. |
void |
setTemplateCache(com.google.common.cache.Cache<String,PebbleTemplate> cache)
Sets the cache to be used for storing compiled PebbleTemplate instances.
|
public PebbleEngine()
public PebbleEngine(Loader loader)
loader - The template loader for this enginepublic PebbleTemplate getTemplate(String templateName) throws PebbleException
templateName - The name of the templatePebbleException - Thrown if an error occurs while parsing the template.public void setLoader(Loader loader)
public Loader getLoader()
public Parser getParser()
public Lexer getLexer()
public void addExtension(Extension extension)
public Map<String,TokenParser> getTokenParsers()
public Map<String,BinaryOperator> getBinaryOperators()
public Map<String,UnaryOperator> getUnaryOperators()
public List<NodeVisitor> getNodeVisitors()
public com.google.common.cache.Cache<String,PebbleTemplate> getTemplateCache()
public void setTemplateCache(com.google.common.cache.Cache<String,PebbleTemplate> cache)
cache - The cache to be usedpublic boolean isStrictVariables()
public void setStrictVariables(boolean strictVariables)
strictVariables setting of the PebbleEngine. If
strictVariables is equal to false (which is the default) then expressions
become much more null-safe and type issues are handled in a much more
graceful manner.strictVariables - Whether or not strict variables is usedpublic Locale getDefaultLocale()
public void setDefaultLocale(Locale locale)
locale - The default locale to pass to all newly compiled templates.public ExecutorService getExecutorService()
public void setExecutorService(ExecutorService executorService)
executorService - The ExecutorService to enable multithreading features.Copyright © 2015. All rights reserved.