Class ThymeleafEvaluationContext

Object
org.springframework.expression.spel.support.StandardEvaluationContext
org.thymeleaf.spring5.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 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.

Since:
3.0.3
Author:
Daniel Fernández
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ThymeleafEvaluationContext(org.springframework.context.ApplicationContext applicationContext, org.springframework.core.convert.ConversionService conversionService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.context.ApplicationContext
     
     
    boolean
     
     
    void
     
    void
    setVariableAccessRestricted(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.expression.EvaluationContext

    assignVariable, getBeanResolver, getConstructorResolvers, getMethodResolvers, getOperatorOverloader, getPropertyAccessors, getRootObject, getTypeComparator, getTypeConverter, getTypeLocator, setVariable
  • Field Details

    • THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME

      public static final String THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME
      See Also:
  • Constructor Details

    • ThymeleafEvaluationContext

      public ThymeleafEvaluationContext(org.springframework.context.ApplicationContext applicationContext, org.springframework.core.convert.ConversionService conversionService)
  • Method Details