我想使用JAXB对一个对象进行序列化。我的类定义是这样的。
@XmlRootElement
public class MyClass{
<<How do I annotate this one?>>
private xyz_type xyz;
@XmlElement(name = "unique")
private int unique;
}
public class xyz_type extends abc_type{
private qwe_tpe qwe;
public static final ert_type ARRAY = ert_type.ARRAY;
}
先谢谢你的帮助!
你需要一个客户XML适配器来调集复杂的数据类型。
请参阅本指南。https:/www.baeldung.comjaxb - 6. 复杂数据类型