incubator-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joao Boto <>
Subject complex json file
Date Tue, 11 Nov 2014 15:55:32 GMT
i'm trying to understand how to read a complex json file..

i started with this json (but will work with a much more complex):
"name":{ "first":"Joe", "last":"Sixpack" },

trying to do what Kasper told me on

I wrote the code below, but i can't get "first" and "last" fields..

SimpleTableDef custTable = new SimpleTableDef(
new String[] {"name.first","name.last","gender","verified","userimage"}

SchemaBuilder schema = new SimpleTableDefSchemaBuilder("tester", custTable)
JsonDataContext dc = new JsonDataContext(new FileResource(new
Table table = dc.getDefaultSchema().getTableByName("customer");
Column firstName = table.getColumnByName("name.first");
Column lastName = table.getColumnByName("name.last");
Column gender = table.getColumnByName("gender");
DataSet dataSet =
while ( {
String sFirstName = (String) dataSet.getRow().getValue(firstName);
String sLastName = (String) dataSet.getRow().getValue(lastName);
String sGender = (String) dataSet.getRow().getValue(gender);

can someone tell me what I'm doing wrong or indicate which way to go?


Best regards

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message