I have seen there are many JSON parsers in Java. Some target speed, some target accuracy, some target flexibility (streaming, buffering, etc). Some have use special subclasses of the collections api instead of using the ones that are already there. That seems bloated to me.
So I would like to know, which one(s) tackle the job of string to object conversion in the shortest/simplest manner? (as in, less code)
Edit: I am sorry I was not clear. What I mean is the smallest parser. So if one parser was 600 lines and the other was 400 lines. I don’t care which is faster so much as which is easier to understand. This is not to be confused with how many lines it takes to invoke the parser. I expect almost all would be just a few lines of code and if I have to add a convenience method that is OK.
Purpose is more of an educational thing, how is it done, and the wish to use APIs where it is easy to see how it works.
I can think of two. Jackson or Gson. I’ll add some examples.
GSON
Jackson
Jackson is a little faster so its up to you what you want.