FranzGames / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

how to access embedded tags/key value pairs in JSON data using gson? tried,but it returns "null" #442

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.while trying to access the embedded data using java inner classes
2.even if we have separate classes for different data values..still it returns 
null  
3.

What is the expected output? What do you see instead?
expected output should be the values of the embedded data..but i see null.

What version of the product are you using? On what operating system?
windows; gson 2.2

Please provide any additional information below.
here is part of data which is generated.How do i access submac,subhost?I have 
separate classes for outer data and "sub"
data.
{ 
    "mac": null,
    "ipv4": "198.162.1.1",
    "ipv6": "12.234.345.44",
    "host": "xyz.com",
    "_dns": true,    
    "sub":[ 
    {
    "submac": null,
    "subhost": "xyz12.com"
     }
     ]        
    }

Original issue reported on code.google.com by amathu...@gmail.com on 11 May 2012 at 9:05

GoogleCodeExporter commented 9 years ago

Original comment by limpbizkit on 30 Jun 2012 at 3:19