public class EvaluationContext extends Object
| Constructor and Description |
|---|
EvaluationContext(PebbleTemplateImpl self,
boolean strictVariables,
Locale locale,
Map<String,Filter> filters,
Map<String,Test> tests,
Map<String,Function> functions,
ExecutorService executorService,
ScopeChain scopeChain,
InheritanceChain inheritanceChain)
Constructor used to provide all final variables.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addImportedTemplate(PebbleTemplateImpl template) |
void |
ascendInheritanceChain() |
boolean |
currentScopeContainsVariable(String variableName) |
EvaluationContext |
deepCopy(PebbleTemplateImpl self)
Makes an exact copy of the evaluation context except the "scopeChain"
object will be a deep copy without reference to the original.
|
void |
descendInheritanceChain() |
Object |
get(String key)
Will look for a variable, traveling upwards through the scope chain until
it is found.
|
PebbleTemplateImpl |
getChildTemplate() |
ExecutorService |
getExecutorService() |
Map<String,Filter> |
getFilters() |
Map<String,Function> |
getFunctions() |
List<PebbleTemplateImpl> |
getImportedTemplates() |
Locale |
getLocale() |
PebbleTemplateImpl |
getParentTemplate() |
Map<String,Test> |
getTests() |
boolean |
isStrictVariables() |
void |
popScope() |
void |
pushLocalScope()
Pushes a new scope that doesn't contain a reference to the current scope.
|
void |
pushScope()
Creates a new scope that contains a reference to the current scope.
|
void |
pushScope(Map<String,Object> map) |
void |
put(String key,
Object value)
This method might be called DURING the evaluation of a template (ex.
|
void |
setParent(PebbleTemplateImpl parent) |
EvaluationContext |
shallowCopyWithoutInheritanceChain(PebbleTemplateImpl self)
Makes an exact copy of the evaluation context EXCEPT for the inheritance
chain.
|
public EvaluationContext(PebbleTemplateImpl self, boolean strictVariables, Locale locale, Map<String,Filter> filters, Map<String,Test> tests, Map<String,Function> functions, ExecutorService executorService, ScopeChain scopeChain, InheritanceChain inheritanceChain)
self - The template implementationstrictVariables - Whether strict variables is to be usedlocale - The locale of the templatefilters - Available filterstests - Available testsfunctions - Available functionsexecutorService - The optional executor servicescopeChain - The scope chaininheritanceChain - The inheritance chainpublic EvaluationContext shallowCopyWithoutInheritanceChain(PebbleTemplateImpl self)
self - The template implementationpublic EvaluationContext deepCopy(PebbleTemplateImpl self)
self - The template implementationpublic void put(String key, Object value)
key - Keyvalue - Valuepublic Object get(String key)
key - Keypublic void ascendInheritanceChain()
public void descendInheritanceChain()
public PebbleTemplateImpl getParentTemplate()
public PebbleTemplateImpl getChildTemplate()
public void pushScope()
public boolean currentScopeContainsVariable(String variableName)
public void pushLocalScope()
public void popScope()
public boolean isStrictVariables()
public Locale getLocale()
public ExecutorService getExecutorService()
public void addImportedTemplate(PebbleTemplateImpl template)
public List<PebbleTemplateImpl> getImportedTemplates()
public void setParent(PebbleTemplateImpl parent)
Copyright © 2015. All rights reserved.