• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Bear Bibeault
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • salvin francis
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Jj Roberts

parsing a json recursively and get count of children along with parent child relationship

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

I have a json of the below format:

type1{
categories:
type1{
categories:
type1{}
type2{}
}
type1{
categories:
type1{
categories:
type1{
categories:
type1{}
type2{}
}
type2{}
}
type2{}
}


I have done code to parse this json after defining classes for above json structure

Now I am trying to get count of articles of type1 at each level.

say for example at level1: there are 2 type 1 articles but first type1 child has children type1 and type2

at level2: type1 has children 3 levels further

I am trying with collections but I am held. Could you help me with the logic

Thanks in advance





 
I want my playground back. Here, I'll give you this tiny ad for it:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic