Knowing the current full path when deserializing an object #5894
-
|
Hi, I wonder if there's a way to know the current full path of the object being deserialized. My usecase is to keep a reference to that path in the created object, just as a kind of technical/debugging information (because it can be tricky otherwise, if an issue occurs later with that created object, to trace back to where in the params it was created from). I know how to get that path when a JacksonException occurs (using To be clear, my issue isn't to hook into the object creation process using a custom delegating deserializer to add an automatically computed value to a transient field of the object; it is to compute the actual value to add, which is the full path currently parsed. And also note that I'm aware of Thanks *Such intermediate parsers are needed because I need to buffer the whole tree being parsed ( |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This is a hard problem. For performance reasons we do not construct Location or Path information for all tokens, and that is unlikely to change. But linking of |
Beta Was this translation helpful? Give feedback.
This is a hard problem. For performance reasons we do not construct Location or Path information for all tokens, and that is unlikely to change. But linking of
StreamReadContextcould be considered, for example.