Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that functions are variables in SpEL EvaluationContexts #32258

Closed
sbrannen opened this issue Feb 13, 2024 · 0 comments
Closed

Document that functions are variables in SpEL EvaluationContexts #32258

sbrannen opened this issue Feb 13, 2024 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Milestone

Comments

@sbrannen
Copy link
Member

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.

@sbrannen sbrannen added type: documentation A documentation task in: core Issues in core modules (aop, beans, core, context, expression) labels Feb 13, 2024
@sbrannen sbrannen added this to the 6.1.4 milestone Feb 13, 2024
@sbrannen sbrannen self-assigned this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: documentation A documentation task
Projects
None yet
Development

No branches or pull requests

1 participant