public class EvaluationContextImpl extends Object implements EvaluationContext
| Constructor and Description |
|---|
EvaluationContextImpl(PebbleTemplateImpl self,
boolean strictVariables,
Locale locale,
ExtensionRegistry extensionRegistry,
PebbleCache<CacheKey,Object> tagCache,
ExecutorService executorService,
List<PebbleTemplateImpl> importedTemplates,
Map<String,PebbleTemplateImpl> namedImportedTemplates,
ScopeChain scopeChain,
Hierarchy hierarchy,
EvaluationOptions evaluationOptions)
Constructor used to provide all final variables.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNamedImportedTemplates(String alias,
PebbleTemplateImpl template) |
EvaluationOptions |
getEvaluationOptions()
Returns the evaluation options.
|
ExecutorService |
getExecutorService()
Returns the executor service if exists or null
|
ExtensionRegistry |
getExtensionRegistry()
Returns the extension registry used to access all of the tests/filters/functions
|
Hierarchy |
getHierarchy()
Returns the data structure representing the entire hierarchy of the template currently being
evaluated.
|
List<PebbleTemplateImpl> |
getImportedTemplates()
Returns a list of imported templates.
|
Locale |
getLocale()
Returns the locale
|
PebbleTemplateImpl |
getNamedImportedTemplate(String alias)
Returns the named imported template.
|
ScopeChain |
getScopeChain()
Returns the scope chain data structure that allows variables to be added/removed from the
current scope and retrieved from the nearest visible scopes.
|
PebbleCache<CacheKey,Object> |
getTagCache()
Returns the cache used for the "cache" tag
|
Object |
getVariable(String key) |
boolean |
isStrictVariables()
Returns whether or not this template is being evaluated in "strict templates" mode
|
void |
scopedShallowWithoutInheritanceChain(PebbleTemplateImpl template,
Map<?,?> additionalVariables,
Callbacks.PebbleConsumer<EvaluationContextImpl> scopedFunction) |
EvaluationContextImpl |
shallowCopyWithoutInheritanceChain(PebbleTemplateImpl self)
Makes an exact copy of the evaluation context EXCEPT for the inheritance chain.
|
EvaluationContextImpl |
threadSafeCopy(PebbleTemplateImpl self)
Makes a "snapshot" of the evaluation context.
|
public EvaluationContextImpl(PebbleTemplateImpl self, boolean strictVariables, Locale locale, ExtensionRegistry extensionRegistry, PebbleCache<CacheKey,Object> tagCache, ExecutorService executorService, List<PebbleTemplateImpl> importedTemplates, Map<String,PebbleTemplateImpl> namedImportedTemplates, ScopeChain scopeChain, Hierarchy hierarchy, EvaluationOptions evaluationOptions)
self - The template implementationstrictVariables - Whether strict variables is to be usedlocale - The locale of the templateextensionRegistry - The extension registryexecutorService - The optional executor servicescopeChain - The scope chainhierarchy - The inheritance chaintagCache - The cache used by the "cache" tagpublic EvaluationContextImpl shallowCopyWithoutInheritanceChain(PebbleTemplateImpl self)
self - The template implementationpublic EvaluationContextImpl threadSafeCopy(PebbleTemplateImpl self)
self - The template implementationpublic PebbleTemplateImpl getNamedImportedTemplate(String alias)
public void addNamedImportedTemplates(String alias, PebbleTemplateImpl template)
public boolean isStrictVariables()
isStrictVariables in interface EvaluationContextpublic Locale getLocale()
getLocale in interface EvaluationContextpublic ExtensionRegistry getExtensionRegistry()
public ExecutorService getExecutorService()
public List<PebbleTemplateImpl> getImportedTemplates()
public PebbleCache<CacheKey,Object> getTagCache()
public ScopeChain getScopeChain()
public Hierarchy getHierarchy()
public EvaluationOptions getEvaluationOptions()
public Object getVariable(String key)
getVariable in interface EvaluationContextpublic void scopedShallowWithoutInheritanceChain(PebbleTemplateImpl template, Map<?,?> additionalVariables, Callbacks.PebbleConsumer<EvaluationContextImpl> scopedFunction) throws IOException
IOExceptionCopyright © 2020. All rights reserved.