Closed sbrannen closed 2 weeks ago
Current work on this can be viewed in the following feature branch.
@artembilan, @pilak, @jackmiking, @jdomigon, @martin-jamszolik: you may also be interested in the new ReflectiveIndexAccessor
that I just pushed to main
for inclusion in Spring Framework 6.2 M2.
It greatly simplifies custom index access with zero code (plus built-in compilation support) for the most common use cases.
See commit 35c183d6346d68f443b6d06757f749a3d415bd88 for details.
Overview
Somewhat analogous to the
ReflectivePropertyAccessor
implementation ofPropertyAccessor
, we should introduce a general purposeReflectiveIndexAccessor
implementation as a convenience for users.However,
ReflectiveIndexAccessor
should implementCompilableIndexAccessor
(instead of justIndexAccessor
) in order to provide built-in compilation support.A proof of concept has already been implemented in the tests for
CompilableIndexAccessor
:https://github.com/spring-projects/spring-framework/blob/27d2200058bffb022b43a8bba4399e2fe837ee97/spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationCoverageTests.java#L7238-L7333
Related Issues
26478
32613