java - How do I parse a JSON to JTree and vice versa -
i'm using java, , want parse complex json string (one contains objects, arrays values, , arrays of objects jtree) , vice versa. able create method parses json string (using jackson objectmapper
, jsonnode
) jtree, want tree editable. , once changed, want able parse json string or java class represented json string. there proper way this?
i can advice use gson
(https://sites.google.com/site/gson/gson-user-guide) convert data complex jtree structure , vice versa. can grab java class represented json string
tree , convert json gson
.
as example:
complextreeobject obj = new complextreeobject(); gson gson = new gson(); string json = gson.tojson(obj);
Comments
Post a Comment