Document that functions are variables in SpEL EvaluationContexts #32258
Closed
Description
Although EvaluationContext
defines the API for setting and looking up variables, the internals of the Spring Expression Language (SpEL) actually provide explicit support for registering functions as variables.
This is evident in the two registerFunction()
variants in StandardEvaluationContext
; however, functions can also be registered as variables when using the SimpleEvaluationContext
.
Since custom functions are also viable in use cases involving the SimpleEvaluationContext
, we should document that functions may be registered in a SimpleEvaluationContext
via setVariable()
.
We should also explicitly document the "function as a variable" behavior in the class-level Javadoc for both StandardEvaluationContext
and SimpleEvaluationContext
.
Activity