1. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Rep Power

    Comparing JSON object against JAVA object for equality

    I have a JAVA object. Its a very complex object with lots of nested hierarchies with a total of 50 classes.
    Applying straight away the JSON or Jackson library to the JAVA class has not given successful results so I have made the
    custom converted and successfully converted the java object to json(using JSON and Jackson).
    At times, I have to define a new property with same name as interface in json for interfaces since we don't have interfaces in json/javascript

    How can I compare my generated JSON object with the JAVA object for equality and ensure that no properties etc are missed?
    Contact info:
    Primary email: advanced.programmer@gmail.com
    MSN/email: superprg@hotmail.com
    AIM: superprg
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Rep Power
    If you're looking for some automated way to compare an arbitrary Java object and JSON object I don't think you're going to find one.

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo