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

support retrieval of the event for the current parsing state in JsonParser #233

Closed
emattheis opened this issue Feb 20, 2020 · 2 comments
Closed

Comments

@emattheis
Copy link

I'm interested in using JSON-P and JSON-P together in order to efficiently process large JSON data sets while retaining the convenience of POJO mapping. I've raised an issue with the JSON-B API to that end, but one of the sticking points is the ability to properly position a JsonParser for use by JSON-B. It would be convenient if JsonParser had a peek() method that could return the next event without consuming it.

@emattheis emattheis changed the title support peek() for next event in JsonParser support retrieval of the event for the current parsing state in JsonParser Feb 21, 2020
@emattheis
Copy link
Author

After thinking about this more carefully, it seems that providing access to the current event is likely much more efficient than trying to provide lookahead support. For the use case I'm interested in, a JsonParser instance could be advanced to the correct location and then passed to a Jsonb instance to deserialize a mapped POJO but the Jsonb needs to be aware of the current event, otherwise it must call next() which means the caller has to advance the stream only to the position directly before the correct location. This forces the caller to make assumptions about the future state of the stream and depend on error handling to recover if those assumptions don't hold.

@lukasj
Copy link
Contributor

lukasj commented Oct 15, 2021

I believe this is covered by #282

@lukasj lukasj closed this as completed Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants