[json-lib-user] JSONObject.fromObject()
Brought to you by:
aalmiray
From: zhang x. <zha...@gm...> - 2006-07-28 20:25:13
|
When i use JSONObject.fromObject() as this: class Bean { public String getName() { return "bean[name]"; } public String[] getArray() { String[] array = new String[3]; array[0] = "bean[array][0]"; array[1] = "bean[array][1]"; array[2] = "bean[array][2]"; return array; } } .... JSONObject json; json = JSONObject.fromObject(new Bean()); System.out.println(json.toString(2)); ... and a "{}" was printed and i expected a string such as "{name: 'bean[name]', array:['bean[array][0]', ...]}", is there any misunderstand in my code? -- The stars, my destination. |