是否有可能創建JSON可以反序列化的Java中的POJO類?將具有不定域的Json反序列化爲Java中的POJO
{
"name": "value",
"random-value-01" : {
"constant-field-00":"value_00",
"constant-field-01":"value_01"
},
"random-value-02" : {
"constant-field-00":"value_02",
"constant-field-01":"value_03"
},
...
"random-value-XX" : {
"constant-field-00":"value",
"constant-field-01":"value"
},
}
除非您願意使用地圖,否則不會。但我會質疑爲什麼你要首先像這樣格式化它。 –