0
JAXB生成後、私のint配列に間違った型を含むクラスがあり、int []ではなくInteger型でアノテートします。ここJAXB生成後のアノテーションタイプが正しくありません
は私のXSDです:
<complexType name="GenericChartTask">
<sequence>
<element name="clients" type="struct:IDNameSiteServiceImageIndex"
maxOccurs="unbounded" minOccurs="0">
</element>
<element name="commonTasks" type="struct:NameAndID"
maxOccurs="unbounded" minOccurs="0">
</element>
<element name="groups" type="int" maxOccurs="unbounded"
minOccurs="0"></element>
<element name="siteServices" type="struct:SiteService"
maxOccurs="unbounded" minOccurs="0">
</element>
</sequence>
</complexType>
そして、ここでは、私が作成した後に得るものです:
public class GenericChartTask {
@XmlElement(namespace = "http://american-data.com/ecs/struct")
protected ad.ecs.struct.IDNameSiteServiceImageIndex[] clients;
@XmlElement(namespace = "http://american-data.com/ecs/struct")
protected ad.ecs.struct.NameAndID[] commonTasks;
@XmlElement(namespace = "http://american-data.com/ecs/struct", type = Integer.class)
protected int[] groups;
@XmlElement(namespace = "http://american-data.com/ecs/struct")
protected ad.ecs.struct.SiteService[] siteServices;
...
JAXBは「doesnのため、私はまた、リストの代わりに配列を生成するために結合しています法的なBeanを生成したい(リストのためのsetterを落とす)。私の質問は次のようになり
<jxb:bindings node="//xs:element[@name='groups']">
<jxb:property collectionType="indexed" />
</jxb:bindings>
、その故障部品タイプ= Integer.classを取り除く方法はありますか?なぜなら、このオブジェクトに対してJSONを逆シリアル化するときに問題が発生するからです。
病気はこれを試してみて、あなたはこれで問題が解決しない – serge
を教えて - 私はそれが非リストフィールドになったことを行う場合にもまだ – serge
てみドロップのmaxOccursを生成します。全体の問題はリストについてです... – Revive