• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Expression based Json Query Engine

 
Ranch Hand
Posts: 78
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

Here is a small utility to query the JsonObject for a particular property. It may be helpful to some of you.



It contains a static public method which accepts an expression, property separator and JsonObject.

The expression can be of the form Node1:Node2:Node3, where Node3 is the targetted property and ":" is a property seperator. See Sample.



if you want to query the name property of the above object then you can call the method as


The output of the method is list of string, i.e if the targeted property is a JsonObject then it will be toString() ed.

Regards,
--
Avinash
reply
    Bookmark Topic Watch Topic
  • New Topic