考虑下面的注解
@XmlElements({
@XmlElement(name = "first", type = First.class),
@XmlElement(name = "second", type = Second.class),
@XmlElement(name = "third", type = Third.class),
@XmlElement(name = "fourth", type = Fourth.class),
@XmlElement(name = "fifth", type = Fifth.class),
@XmlElement(name = "sixth", type = Sixth.class),
@XmlElement(name = "seventh", type = Seventh.class)})
private List<Dimension> dimensions = new ArrayList<>();
而且由于一些有趣的传统逻辑的,我需要为Third.class的适配器。
@XmlJavaTypeAdapter(ThirdAdapter.class)
public class Third implements Dimension
然而,ThirdAdapter似乎永远不会被调用。 与@XmlElements @XmlJavaTypeAdapter兼容? 还是有更好的解决呢?