JAXB override @XmlElement type of list
问题 There's a simple class Bean1 with a sublist of type BeanChild1 . @XmlRootElement(name="bean") @XmlAccessorType(XmlAccessType.PROPERTY) public static class Bean1 { public Bean1() { super(); } private List<BeanChild1> childList = new ArrayList<>(); @XmlElement(name="child") public List<BeanChild1> getChildList() { return childList; } public void setChildList(List<BeanChild1> pChildList) { childList = pChildList; } } public static class BeanChild1 { ... } I am trying to override the class, to