I made some classes using xjc.
public class MyType {
@XmlElementRefs({
@XmlElementRef(name = "MyInnerType", type = JAXBElement.class, required = false),
})
@XmlMixed
protected List<Serializable> content;
public List<Serializable> getContent() {
if (content == null) {
content = new ArrayList<Serializable>();
}
return this.content;
}
}
But i cant add inner elements using
getContent().add(newItem);
because MyInnerType is not Serializable. Why its not a List of Objects? How do i add inner elements?