public class EvaluationContext extends Object
| Constructor and Description |
|---|
EvaluationContext(PebbleTemplateImpl self,
boolean strictVariables,
Locale locale,
ExtensionRegistry extensionRegistry,
com.google.common.cache.Cache<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.
|
com.google.common.cache.Cache<CacheKey,Object> |
getTagCache()
Returns the cache used for the "cache" tag
|
boolean |
isStrictVariables()
Returns whether or not this template is being evaluated in "strict templates" mode
|
EvaluationContext |
shallowCopyWithoutInheritanceChain(PebbleTemplateImpl self)
Makes an exact copy of the evaluation context EXCEPT for the inheritance
chain.
|
EvaluationContext |
threadSafeCopy(PebbleTemplateImpl self)
Makes a "snapshot" of the evaluation context.
|
public EvaluationContext(PebbleTemplateImpl self, boolean strictVariables, Locale locale, ExtensionRegistry extensionRegistry, com.google.common.cache.Cache<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 EvaluationContext shallowCopyWithoutInheritanceChain(PebbleTemplateImpl self)
self - The template implementationpublic EvaluationContext threadSafeCopy(PebbleTemplateImpl self)
self - The template implementationpublic boolean isStrictVariables()
public Locale getLocale()
public ExtensionRegistry getExtensionRegistry()
public ExecutorService getExecutorService()
public List<PebbleTemplateImpl> getImportedTemplates()
public PebbleTemplateImpl getNamedImportedTemplate(String alias)
public void addNamedImportedTemplates(String alias, PebbleTemplateImpl template)
public com.google.common.cache.Cache<CacheKey,Object> getTagCache()
public ScopeChain getScopeChain()
public Hierarchy getHierarchy()
public EvaluationOptions getEvaluationOptions()
Copyright © 2018. All rights reserved.