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 | 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: 61766
    
  67

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();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Coping with differing Json object names