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
Introduce ReflectiveIndexAccessor
convenience class in SpEL
#32714
Comments
Current work on this can be viewed in the following feature branch. main...sbrannen:spring-framework:issues/gh-32714-ReflectiveIndexAccessor |
This commit introduces ReflectiveIndexAccessor for the Spring Expression Language (SpEL) which is somewhat analogous to the ReflectivePropertyAccessor implementation of PropertyAccessor. ReflectiveIndexAccessor is a flexible IndexAccessor implementation that uses reflection to read from and optionally write to an indexed structure of a target object. ReflectiveIndexAccessor also implements CompilableIndexAccessor in order to support compilation to bytecode for read access. Closes spring-projectsgh-32714
@artembilan, @pilak, @jackmiking, @jdomigon, @martin-jamszolik: you may also be interested in the new It greatly simplifies custom index access with zero code (plus built-in compilation support) for the most common use cases. See commit 35c183d 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
:spring-framework/spring-expression/src/test/java/org/springframework/expression/spel/SpelCompilationCoverageTests.java
Lines 7238 to 7333 in 27d2200
Related Issues
IndexAccessor
SPI to customize the SpELIndexer
#26478CompilableIndexAccessor
SPI in SpEL #32613The text was updated successfully, but these errors were encountered: