说明: xml是调用外部系统返回的, 收费服务, 格式无法更改
<?xml version="1.0" encoding="utf-8"?>
<INFO>
<status>
....
....
</status>
<order>
<id></id>
<code></code>
.......
</order>
<order>
<id></id>
<code></code>
.......
</order>
<order>
<id></id>
<code></code>
.......
</order>
<order>
<id></id>
<code></code>
.......
</order>
</INFO>
</xml>
@XmlRootElement(name = "INFO")
public class OrderResponse {
private Status status;
private List<Order> orderList;
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public List<Order> getOrderList() {
return orderList;
}
public void setOrderList(List<Order> orderList) {
this.orderList = orderList;
}
}
尝试过
@XmlElements({
@XmlElement(name = "order", type = Order.class),
})
但结果都是解析不出来。
status对象是可以解析的, orderList的注解应该是什么?
慕田峪4524236
相关分类