assignVariable abstract method

Object? assignVariable(
  1. String name,
  2. Object? valueSupplier()
)

Stores the value from valueSupplier in #name and returns it; the evaluator calls this for #name = ... and #name++ inside an expression.

It is separate from setVariable so that a context can refuse assignments written in expressions while still accepting variables set from code: a SimpleEvaluationContext throws SpelMessage.variableAssignmentNotSupported (EL1080E).

Implementation

Object? assignVariable(String name, Object? Function() valueSupplier);