1
在<Images>
標記中,this API call返回不同類型的混合:fanart,boxart,banner,screenshot,clearlogo。使用SimpleXML解析混合列表
使用SimpleXML框架,將這些解析到單獨的列表中的最佳方法是什麼?我想要一個List<FanArt>
,List<BoxArt>
,List<Banner>
等網站上的examples似乎不包括這種情況。我已經摸索了幾個不同的想法,但我甚至不確定SimpleXML框架能夠以一種簡單的方式處理這個問題。
例如,下面拋出此異常:org.simpleframework.xml.core.PersistenceException:名現場 'clearLogos' '形象' 的重複標註.....
@ElementList(name = "Images", entry = "clearlogo")
private List<ClearLogo> clearLogos;
@ElementList(name = "Images", entry = "boxart")
private List<BoxArt> boxart;