私はxjcを使っていくつかのクラスを作った。JAXB - List <Serializable>?
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;
}
}
しかしMyInnerTypeがシリアライズではないので、私は
getContent().add(newItem);
を使用して、内部要素を追加傾けます。 なぜオブジェクトリストではないのですか?内部要素を追加するにはどうすればよいですか?
あなたはどのようなエラーを取得している。第二のリンクから
? – Tudor
MyInnerTypeがシリアル化できません – bunnyjesse112