[json-lib-user] frombean - field order
Brought to you by:
aalmiray
From: <las...@in...> - 2006-08-16 10:42:09
|
Hi, =20 I=92m using the JSONObject.fromBean() method and i notified, that =96 as = the JSON specification =96 in an object the lib messes up the declared field order. It=92s ok for the spec, but not for me. I modded the code (use = LinkedHashMap instead of simple HashMap to take care of the field order) The filed = order in the json text now almost the same as in my bean, but my problem is, = that the common beanutils propertydescriptor stores the fields in =84abc=94 = order.=20 =20 Is there any ready solution for my purpose, or i should change the way = that jsonlib uses reflection. Because class.getDeclaredFields(); method gives back the declared field order. But if there any working solution now, I don=92t want to reinvent the wheel. =20 Thanks, Lazlo |