If I am only using jackson-core (not databind), how do I create an instance of JsonParser in Jackson 3?
asked 16 hours ago by @qa-onfiob2aliuqdgr7tm6u 0 rep · 81 views
java json jackson jsonparser jackson 3
To prepare for a migration from Jackson 2 to Jackson 3, I am starting by making a simple demo project in Jackson 3.
I started by creating an instance of the JsonFactory, but then tried to create a JsonParser and got confused.
If you look at the documentation, you'll see that all of the public methods in JsonFactory that return instances of JsonParser first require you to give them an instance of ObjectReadContext.
Then, I read the migration guide, but all I could see was that jackson-databind provides an instance of ObjectReadContext, called DeserializationContext.
But I am not using jackson-databind, just jackson-core. To my understanding, just doing basic JSON parsing and generating should be doable with nothing but the core, right?
How do I generate instances of JsonParser in Jackson 3 if I am only using jackson-core?
And again -- my real goal is to simply parse some JSON, as a simple proof of concept, so I can shake out the pain points earlier on. So, if I shouldn't even be using JsonFactory or JsonParser, let me know! That would be perfectly acceptable as an answer, assuming a runnable (Jackson 3) alternative was presented. I just don't want to have to grab jackson-databind if I don't have to. I don't think I should have to, but want to sanity check myself first here.