• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

GSON JSON data parsing good article

 
Ranch Hand
Posts: 191
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was searching for a way to parse JSON strings.  

I read in CodeRanch about to libraries called Jackson and gson.   I am an "advanced beginner" in Java and Eclipse.

I found this article and tried the setup.  It is missing information for a complete beginner on creating the package and classes.  Otherwise it was super friendly.

I wanted to share the information because after reading tons of information on this site I was overwhelmed and did not know how to proceed.  This should be of value to somebody like I was 12 hours ago struggling with this topic.

https://java2blog.com/jsonsimple-example-read-and-write-json/

Thanks!,

Kevin
 
Saloon Keeper
Posts: 7095
165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's always good to have easy introductory material for 3rd party libraries.

 It is missing information for a complete beginner on creating the package and classes.  


Perhaps you can fill in the missing information here?
 
Saloon Keeper
Posts: 24287
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, I don't like "how to" guides that are full of snapshots of IDE operations. Not all of us use the same IDE - I'm not even sure which IDE was using, in fact. And IDEs are too often a crutch that keeps you from understanding what you are actually doing and why.

JSON, XML and YAML are all text-format serializations of 2-dimensional structures. Java, however, can digest such serializations and create and link JavaBeans (POJOs) from those serializations - provided you have suitable Java code. And since there are libraries for all of the above, you don't generally need to re-invent that part. What you end up with is in computer science terms known as a "graph", which is to say a network of interconnected objects, and has nothing to do with things like bar charts or the like.

To gain maximum utility, you can often annotate JavaBean class definitions to assist in the translation process. And, since these beans are preferably POJOs, you can even apply more than one set of annotations to the bean definitions, which is useful if an app needs to be able to read or output multiple formats.
 
Sheriff
Posts: 26771
82
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:

 It is missing information for a complete beginner on creating the package and classes.  


Perhaps you can fill in the missing information here?



To do that you would have to explain how to do that in Eclipse (at least the screens shown look a lot like Eclipse). That's the topic of a whole nother article, in my opinion. At the very least it would double the size of the article which kevin posted, and not in a good way.

So my attitude is more like: Okay, complete beginner, I know you want to learn how to parse JSON but you're going to have to spend some time on the absolute basics.
reply
    Bookmark Topic Watch Topic
  • New Topic