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

feature request: allow to define max-depth for an object graph #46

Closed
donshop11 opened this issue Jul 11, 2015 · 1 comment
Closed

feature request: allow to define max-depth for an object graph #46

donshop11 opened this issue Jul 11, 2015 · 1 comment
Assignees

Comments

@donshop11
Copy link

it is sometimes useful, when the object graph is very big, to define maximum depth for the traversal.
is it possible to do today?

@jdereg
Copy link
Owner

jdereg commented Jul 12, 2015

Although it is not possible to define maximum depth, I am not sure I would want that. If it stopped writing or reading at a certain depth, the resulting graph would be incomplete and therefore potentially untrustworthy.

I would like to point out that although the parser uses a stack-based parse, the conversion from Maps to Objects uses an explicit Stack object (limited only by the size of the heap). Similarly, the writer uses an explicit Stack for tracing the graph to find references (limited only by the size of the heap) but it does uses the Java stack while writing.

On my list of 'TODO's' for json-io, is to convert those final two instances of recursion to use an explicit stack, thereby making all graph traversal bound only by heap size. I plan to attack the parser first, release with that, and then the writer. This will not happen soon (in next couple of weeks), but it will happen.

@jdereg jdereg self-assigned this Jul 20, 2015
@jdereg jdereg closed this as completed Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants