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

Enable to skip content reading/materialization #234

Open
rmannibucau opened this issue Feb 24, 2020 · 5 comments
Open

Enable to skip content reading/materialization #234

rmannibucau opened this issue Feb 24, 2020 · 5 comments

Comments

@rmannibucau
Copy link

Follow up of jakartaee/jsonb-api#224 (comment)

Would be neat to have a way to skip some elements so instead of materializing it. Concretely it means next will need a skip equivalent, visiting the stream but ignoring the content. GetXxx would fail if called after a skip.

@emattheis
Copy link

There is nothing in the JSON-P API that prevents an implementation from lazily fetching entries, is there? My understanding is that the call to next() advances the stream and subsequent getXXX() call are used to to fetch entries. An implementation should be free to optimize away any materialization of intermediate entries if getXXX() is never called.

@jjspiegel
Copy link

This is my understanding as well. There is also JsonParser#skipObject() and skipArray() which can be used to avoid even having to manifest the skipped events.

@rmannibucau
Copy link
Author

There is nothing in the JSON-P API that prevents an implementation from lazily fetching entries, is there?

There is nothing which enforces it so assume it is not the case (spec world).

@emattheis
Copy link

Does JSON-P even have a published spec? All I can find is the API.

@alexsm82
Copy link

There is no spec document for JSON-P. The Javadocs/TCK constitute the spec.

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

4 participants