0

the answer chosen as the correct answer for this query:

=">Split JSON string into two variables

(assuming 'jsonStr' itself is an array streamed in from a php program, from which the variables are extracted),

Is there some way to use that or similar way to parse multidimensional arrays being streamed in?(i am not sure if I am using that term correctly, what I mean is arrays that contain arrays).

If I have the same object mappings in my java program as my php, I want to be able to repopulate the java objects array by array.

Sorry for reposting here but the question is really relevant since I have already used the solution, but wish to use it in a different way.

1 Answers1

0

Just use a parser like Jackson, and you can parse any valid JSON.

Vidya
  • 29,932
  • 7
  • 42
  • 70
  • How does Jackson compare to Gson and Flexjson? – raffian Oct 16 '13 at 02:25
  • You will of course get a million opinions, but mine is that there is nothing faster and easier to use than Jackson. Still, I suggest you try a few and see how you feel--particularly with regard to your array-based use case. – Vidya Oct 16 '13 at 03:28
  • I had issues with Gson with nested structures; too much boiler plate code to get it working. Flexjson made things easy. – raffian Oct 16 '13 at 03:35
  • So then to answer your question, there are lots of options to parse JSON in Java! – Vidya Oct 16 '13 at 03:39