org.thymeleaf.context
Interface IProcessingContext

All Known Implementing Classes:
AbstractDialectAwareProcessingContext, AbstractProcessingContext, Arguments, DialectAwareProcessingContext, ProcessingContext

public interface IProcessingContext

Since:
2.0.9
Author:
Daniel Fernández

Method Summary
 Map<String,Object> getBaseContextVariables()
          Deprecated. Use getExpressionObjects() instead. Will be removed in 2.1.x
 IContext getContext()
           Returns the current context specified for template processing.
 Object getExpressionEvaluationRoot()
           Returns the current evaluation root.
 Map<String,Object> getExpressionObjects()
           Returns the map of expression objects that should be made available to every expression evaluation operation (whenever variable evaluation is available).
 Object getExpressionSelectionEvaluationRoot()
           Returns the current selection evaluation root.
 Object getLocalVariable(String variableName)
           Returns the value of a local variable.
 Map<String,Object> getLocalVariables()
           Returns the map of local variables.
 Object getSelectionTarget()
           Returns the selection target object, and raises an exception if there isn't any.
 boolean hasLocalVariable(String variableName)
           Returns whether a specific local variable is defined or not.
 boolean hasLocalVariables()
           Returns whether local variables have currently been specified or not.
 boolean hasSelectionTarget()
           Returns whether there currently is a selection going on (e.g.
 

Method Detail

getContext

IContext getContext()

Returns the current context specified for template processing.

Returns:
the current context

getBaseContextVariables

@Deprecated
Map<String,Object> getBaseContextVariables()
Deprecated. Use getExpressionObjects() instead. Will be removed in 2.1.x

Returns the map of base variables that should be made available to every expression evaluation operation (whenever variable evaluation is available).

Returns:
the map of variables (a new object, mutable, safe to use as a context variables base)

getExpressionObjects

Map<String,Object> getExpressionObjects()

Returns the map of expression objects that should be made available to every expression evaluation operation (whenever variable evaluation is available). In OGNL and SpringEL expressions, these will be available as #object1, #object2, etc.

Returns:
the map of objects

getExpressionEvaluationRoot

Object getExpressionEvaluationRoot()

Returns the current evaluation root. This is the object on which expressions (normal expressions, like those specified in the standard dialect with ${...}) are executed.

Returns:
the expression evaluation root

getExpressionSelectionEvaluationRoot

Object getExpressionSelectionEvaluationRoot()

Returns the current selection evaluation root. This is the object on which selection expressions (like those specified in the standard dialect with *{...}) are executed.

Returns:
the selection evaluation root

hasSelectionTarget

boolean hasSelectionTarget()

Returns whether there currently is a selection going on (e.g. th:object in standard dialect).

Returns:
true if there is a selection currently established, false if not

getSelectionTarget

Object getSelectionTarget()

Returns the selection target object, and raises an exception if there isn't any.

Meant for internal use.

Returns:
the selection target object

hasLocalVariables

boolean hasLocalVariables()

Returns whether local variables have currently been specified or not. (e.g. th:with in standard dialect).

Returns:
true if there are local variables, false if not

hasLocalVariable

boolean hasLocalVariable(String variableName)

Returns whether a specific local variable is defined or not.

Returns:
true if the variable is currently defined, false if not.

getLocalVariable

Object getLocalVariable(String variableName)

Returns the value of a local variable.

Parameters:
variableName - the name of the local variable to be returned
Returns:
the value of the variable, or null if the variable does not exist (or has null value)

getLocalVariables

Map<String,Object> getLocalVariables()

Returns the map of local variables.

Returns:
the local variables


Copyright © 2013 The THYMELEAF team. All Rights Reserved.