-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Support Iterable
in SpEL Indexer
#26323
Support Iterable
in SpEL Indexer
#26323
Conversation
* make object implementing java.lang.Iterable accessible with SpEL indexing * only read access is possible, as we cannot write an iterable object * make compiler compatible
4903437
to
bdd8c10
Compare
Is it reasonable to support access to For example, the Javadoc for
Thus, for many |
@sbrannen thank you for the interesting notice In the Javadoc of java.util.List#iterator, we can read this:
So I guess that in most cases the Iterator will preserve the ordering, it would be worth to allow the access with Indexer. Furthermore, if the user traverses the object in an indexing manner (using [n]), isn't that its own responsibility to know if the underlying Iterator is ordered or not? Thanks for your advises |
Superseded by #26409 |
Iterable
in SpEL Indexer
I realize this issue was closed 3 years ago, but I discovered there are already ways to "index" into an In 4.2, @jhoeller added collection selection/projection support for In light of that I introduced dedicated tests to show this in action. Note that the Lines 169 to 194 in 43bbe8f
In summary, given an
|
indexing