aspose file tools
The moose likes Other Open Source Projects and the fly likes Coping with differing Json object names Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "Coping with differing Json object names" Watch "Coping with differing Json object names" New topic
Author

Coping with differing Json object names

M Bryan
Ranch Hand

Joined: Jun 15, 2011
Posts: 57
Hi,

from a website I am getting a request in json format. It roughly looks like this:



Usually, I would write something like jsonObject.getAsJsonObject("343153"), but this does not work in this case, since the IDs differ.
How can I extract that two entries into something like a list?

Thank you
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56162
    
  13

It might help to mention which JSON library you are using.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
M Bryan
Ranch Hand

Joined: Jun 15, 2011
Posts: 57
Google gson
M Bryan
Ranch Hand

Joined: Jun 15, 2011
Posts: 57
Okay I found it out: jo.entrySet();
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Coping with differing Json object names
 
Similar Threads
Struts2 mapping query
Javascript array to JSON object via jquery
ContentNegotiatingViewResolver
Remove "@" from attributes in JSON generated by Xstream?
jQuery.getJSON callback not executing