public final class ThymeleafEvaluationContext extends org.springframework.expression.spel.support.StandardEvaluationContext implements IThymeleafEvaluationContext
Thymeleaf's basic implementation of the IThymeleafEvaluationContext
interface, which in turn extends
from Spring's EvaluationContext
interface.
This implementation adds Thymeleaf's own property accessors
(see PropertyAccessor
) for accessing
the IContext
object in which variables are stored.
Also, this evaluation context (which is usually instanced at the
ThymeleafView
initialization) links the execution of expressions
with the available BeanFactory
and ConversionService
instances, used during evaluation.
Before executing a Spring EL expression using this evaluation context, it should be enriched with the
variables to be made accessible (like #variableName), using a
ThymeleafEvaluationContextWrapper
object.
Modifier and Type | Field and Description |
---|---|
static String |
THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME |
Constructor and Description |
---|
ThymeleafEvaluationContext(org.springframework.context.ApplicationContext applicationContext,
org.springframework.core.convert.ConversionService conversionService) |
Modifier and Type | Method and Description |
---|---|
org.springframework.context.ApplicationContext |
getApplicationContext() |
org.thymeleaf.expression.IExpressionObjects |
getExpressionObjects() |
boolean |
isVariableAccessRestricted() |
Object |
lookupVariable(String name) |
void |
setExpressionObjects(org.thymeleaf.expression.IExpressionObjects expressionObjects) |
void |
setVariableAccessRestricted(boolean restricted) |
addConstructorResolver, addMethodResolver, addPropertyAccessor, getBeanResolver, getConstructorResolvers, getMethodResolvers, getOperatorOverloader, getPropertyAccessors, getRootObject, getTypeComparator, getTypeConverter, getTypeLocator, registerFunction, registerMethodFilter, removeConstructorResolver, removeMethodResolver, removePropertyAccessor, setBeanResolver, setConstructorResolvers, setMethodResolvers, setOperatorOverloader, setPropertyAccessors, setRootObject, setRootObject, setTypeComparator, setTypeConverter, setTypeLocator, setVariable, setVariables
public static final String THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME
public ThymeleafEvaluationContext(org.springframework.context.ApplicationContext applicationContext, org.springframework.core.convert.ConversionService conversionService)
public org.springframework.context.ApplicationContext getApplicationContext()
public Object lookupVariable(String name)
lookupVariable
in interface org.springframework.expression.EvaluationContext
lookupVariable
in class org.springframework.expression.spel.support.StandardEvaluationContext
public boolean isVariableAccessRestricted()
isVariableAccessRestricted
in interface IThymeleafEvaluationContext
public void setVariableAccessRestricted(boolean restricted)
setVariableAccessRestricted
in interface IThymeleafEvaluationContext
public org.thymeleaf.expression.IExpressionObjects getExpressionObjects()
getExpressionObjects
in interface IThymeleafEvaluationContext
public void setExpressionObjects(org.thymeleaf.expression.IExpressionObjects expressionObjects)
setExpressionObjects
in interface IThymeleafEvaluationContext
Copyright © 2017 The THYMELEAF team. All rights reserved.