• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Need some help parsing JSON to Java using GSON.

 
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I'm trying to pass the following code from JSON to JAVA:




I would like for each boxid .. to be parsed Into the relevant credentials/routes.

Should I be converting this specific JSON format to a two dimensional Array for each boxid ?
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
2D array? Why? The JSON specifies a list of strings for the route.

For future posts, please format the JSON across multiple lines rather than one single and long line.
 
Nikolas Nikolaou
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. Thanks for the reply.

I only learned about JSON a few days ago and am trying to grasp the syntax / parsing process.

As mentioned earlier, I need to retrieve the routes for a specific boxID. A list of boxID's will be retrieved from a serve In the format below.

So far, the Info I am finding Involves creating classes with predefined strings/arrays etc and loading these values from JSON to the JAVA class.

I cannot do this as I will be downloading Info on the fly.

What would be the best procedure to Just retrieve the required values as Strings/Arrays ?

 
Nikolas Nikolaou
Ranch Hand
Posts: 101
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To sum it up, I basically need help parsing the data when the fields will be unknown.

I can't create predefined strings / arrays.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic