This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
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: 64
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: 61314
    
  66

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
M Bryan
Ranch Hand

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

Joined: Jun 15, 2011
Posts: 64
Okay I found it out: jo.entrySet();
 
GeeCON Prague 2014
 
subject: Coping with differing Json object names