return flag;
}
@SuppressWarnings("unchecked")
private boolean addJSONObjectValues(JSONObject obj, Worksheet worksheet, HTable htable, RepFactory factory, Row row, String newHNodeId) {
HNode ndid = htable.getHNode(newHNodeId);
HTable nestedHTable = ndid.getNestedTable();
if (nestedHTable == null)
nestedHTable = ndid.addNestedTable("Table for test",
worksheet, factory);
Table nestedTable = row.getNode(newHNodeId).getNestedTable();
Row r = nestedTable.addRow(factory);
boolean flag = false;
for (Object key : new TreeSet<Object>(obj.keySet())) {
Object value = obj.get(key.toString());
HNode h = nestedHTable.getHNodeFromColumnName(key.toString());
if ( h == null) {
h = nestedHTable.addHNode(key.toString(), type, worksheet, factory);
}
outputColumns.add(h.getId());
//
if (value instanceof String)
flag |= addValues(r.getNode(h.getId()), (String)value, factory, nestedTable);
if (value instanceof JSONObject)
flag |= addJSONObjectValues((JSONObject)value, worksheet, nestedHTable, factory, r, h.getId());
if (value instanceof JSONArray)
flag |= addJSONArrayValues((JSONArray) value, worksheet, nestedHTable, factory,r, h.getId());
}
if (!flag)
nestedTable.removeRow(r);
return flag;
}