2015-04-17 29 views
0

現在我有這樣的代碼:使用標籤屬性

@ElementListUnion({ 
     @ElementList(entry = "broom", type = Broom.class, inline = true), 
     @ElementList(entry = "update", type = Update.class, inline = true) 
}) 
private List<Task> tasks; 

有了這個代碼,我可以用XML寫這些標籤:此標籤

<broom/> 
<update/> 

和不同類別將會被使用。

現在我想寫這個XML:

<entry name="broom"/> 
<entry name="update"/> 

是否有可能改變我的註釋,所以這兩個標記將被用於不同的課?

回答