Ich benutze Federrahmen.Wie schreibe ich eine Java-Struktur und Serializer/Deserializer zu JSON
Ich möchte Java-Baumstruktur und zu JSON
implementieren.
wie unten JSON
,
[
{"id":"1","pid":"0","name":"n1", "chindren":[
{"id":"4","pid":"1","name":"n4", "chindren":[
{"id":"7","pid":"4","name":"n7", "chindren":[
{"id":"15","pid":"7","name":"n15"}
]},
{"id":"8","pid":"4","name":"n8"},
{"id":"9","pid":"4","name":"n9"},
{"id":"10","pid":"4","name":"n10"}
]},
{"id":"5","pid":"1","name":"n5","chindren":[
{"id":"19","pid":"5","name":"n19"},
{"id":"20","pid":"5","name":"n20"}
]}
]},
{"id":"2","pid":"0","name":"n2","chindren":[
{"id":"13","pid":"2","name":"n13"}
]},
{"id":"3","pid":"0","name":"n3","chindren":[
{"id":"11","pid":"3","name":"n11"},
{"id":"12","pid":"3","name":"n12"}
]}
]
Wie oben JSON Baum auf einer Java-Klasse und Serializer/Deserializer
zu JSON
StackOverflow ist kein Code-Schreibdienst! Zeigen Sie uns, was Sie bisher versucht haben und stellen Sie eine spezielle Frage! – ParkerHalo