Class ThymeleafEvaluationContext
- Object
-
- org.springframework.expression.spel.support.StandardEvaluationContext
-
- org.thymeleaf.spring3.expression.ThymeleafEvaluationContext
-
- All Implemented Interfaces:
org.springframework.expression.EvaluationContext,IThymeleafEvaluationContext
public final class ThymeleafEvaluationContext extends org.springframework.expression.spel.support.StandardEvaluationContext implements IThymeleafEvaluationContext
Thymeleaf's basic implementation of the
IThymeleafEvaluationContextinterface, which in turn extends from Spring'sEvaluationContextinterface.This implementation adds Thymeleaf's own property accessors (see
PropertyAccessor) for accessing theIContextobject in which variables are stored.Also, this evaluation context (which is usually instanced at the
ThymeleafViewinitialization) links the execution of expressions with the availableBeanFactoryandConversionServiceinstances, 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 aThymeleafEvaluationContextWrapperobject.- Since:
- 2.1.0
- Author:
- Daniel Fernández
-
-
Field Summary
Fields Modifier and Type Field Description static StringTHYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME
-
Constructor Summary
Constructors Constructor Description ThymeleafEvaluationContext(org.springframework.context.ApplicationContext applicationContext, org.springframework.core.convert.ConversionService conversionService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.context.ApplicationContextgetApplicationContext()org.thymeleaf.expression.IExpressionObjectsgetExpressionObjects()booleanisVariableAccessRestricted()ObjectlookupVariable(String name)voidsetExpressionObjects(org.thymeleaf.expression.IExpressionObjects expressionObjects)voidsetVariableAccessRestricted(boolean restricted)-
Methods inherited from class org.springframework.expression.spel.support.StandardEvaluationContext
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
-
-
-
-
Field Detail
-
THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME
public static final String THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()
-
lookupVariable
public Object lookupVariable(String name)
- Specified by:
lookupVariablein interfaceorg.springframework.expression.EvaluationContext- Overrides:
lookupVariablein classorg.springframework.expression.spel.support.StandardEvaluationContext
-
isVariableAccessRestricted
public boolean isVariableAccessRestricted()
- Specified by:
isVariableAccessRestrictedin interfaceIThymeleafEvaluationContext
-
setVariableAccessRestricted
public void setVariableAccessRestricted(boolean restricted)
- Specified by:
setVariableAccessRestrictedin interfaceIThymeleafEvaluationContext
-
getExpressionObjects
public org.thymeleaf.expression.IExpressionObjects getExpressionObjects()
- Specified by:
getExpressionObjectsin interfaceIThymeleafEvaluationContext
-
setExpressionObjects
public void setExpressionObjects(org.thymeleaf.expression.IExpressionObjects expressionObjects)
- Specified by:
setExpressionObjectsin interfaceIThymeleafEvaluationContext
-
-