Dexter Cato
Dexter Cato

Reputation: 1191

How can I find the current full path of a json node using Jackson?

I have a JsonParser defined in the class. I will be traversing through it. But when I do that, I will need to get the full path of the current node I am in. What is the best way to extract the full path without affecting the performance. Is there an API in Jackson that already does that?

Upvotes: 5

Views: 3171

Answers (1)

StaxMan
StaxMan

Reputation: 116630

You can get context information with JsonParser.getParsingContext(). Or, if you want location relative to input source (line, column), you can use JsonParser.getLocation().

Upvotes: 0

Related Questions