-
Notifications
You must be signed in to change notification settings - Fork 6
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
add location data to JsonNode so that DOM tree elements could be mapped back to their location in a source document #20
Comments
I can see how this could be useful. Implementation could be rather tricky however. |
the information is (sometimes) already available. for example, here's a demo parsing a json file:
which produces
seems to me granted, its not complete coverage of all cases from all sources, but its something, and probably useful. |
Yes I am well aware that location information is parsed by streaming parser. Challenges are due to cost of constructing and storing But bigger practical problem is that of I'll keep this option if anyone feels tackling it at some point. Thank you for suggesting it! |
i would be fine with making this option (off by default) effectively copying |
so , can i get the location from json in current version? |
@wangxi761 You can get location from |
sometimes it is Needed,and Let people maintain their custom JsonNodeDeserializer is costly have any future plan to make it? |
@wangxi761 I don't have time or personal interest to work on this. Maybe someone else can contribute something if they are interested and have time. |
i have a plan to solve it , but if we want to achieve it elegantly |
I think that you may want to tackle problems separately: one would be to get and store Location along with nodes; the other to fix issues with actual Location tracking in parser (for whatever changes you think are needed there). Depending on your use case creating your own object model, deserializer, might require bit of work but may also be easier than trying to change I am not sure how visitor pattern would work here: one of the challenges is that |
this is useful for emitting helpful error msgs:
System.err.println("there's something i dont like about " + someJsonNode.position()
this is available when JsonNodeDeserializer is reading the tree
The text was updated successfully, but these errors were encountered: