Java 1.8 と FasterXML を使用しています。
JSON 配列で構成される配列リストがあるとします。
[
{
"id": "8",
"musician": {
"band": {
"bandId": "104"
},
"genre": {
"type": "country",
"typeId": 123
},
"musician": {
"id": "87"
}
}
},
{
"id": "9",
"musician": {
"band": {
"bandId": "104"
},
"genre": {
"type": "country",
"typeId": 123
},
"musician": {
"id": "88"
}
}
}
]
public class Musician {
private int id;
private Band band;
private Genre genre;
// How to marshal this?
private Musician musician;
}
public class Band {
private bandId;
}
public class Genre {
private String type;
private String typeId;
}
クラス内から同じ型 (これは ) をマーシャリングする必要がある場合、最上位クラスをセットアップする方法はMusician
?
使用する注釈はありますか?
内部の Musician クラスに別の名前を付ける必要がありますか?