json - Xively ParserUtil API -


i trying use parserutil deserialize , serialize xively data objects such datastream , datapoint.

while tojson function works perfectly, can't toconnectedobject , toconnectedobjects function working.

the following code excerpt , corresponding log.

string jsondp=parserutil.tojson(false, dp);  datapoint dpnew=parserutil.toconnectedobject(jsondp, datapoint.class);  logger.debug(parserutil.tojson(false, dpnew)); 

log:

2013-08-28 11:45:31,348 2064  debug [parserutil.java: 136] (main:) parsing models json 2013-08-28 11:45:31,376 2092  debug [parserutil.java: 187] (main:) parsed json     models: {"datapoints":[{"at":"2012-02-19t00:00:02.283064z","value":"261"}]} 2013-08-28 11:45:31,376 2092  debug [parserutil.java: 221] (main:) parsing string object: {"datapoints":[{"at":"2012-02-19t00:00:02.283064z","value":"261"}]} 2013-08-28 11:45:31,377 2093  debug [parserutil.java: 136] (main:) parsing models json 2013-08-28 11:45:31,377 2093  debug [parserutil.java: 187] (main:) parsed json models: {"datapoints":[{"value":null}]} 2013-08-28 11:45:31,377 2093  debug [xivelyhelper.java: 295] (main:) {"datapoints":[{"value":null}]} 

the result of toconnectedobject(jsondp, datapoint.class), newdp object, has both fields "at" , "value" set null.

i tried same procedure datastream object fields null well.

in case datapoints in array 1 element.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -