質問

I'm generating an object which has an XSD schema

<xs:element name="roleAssignments" minOccurs="0">
 <xs:complexType>
  <xs:sequence>
     <xs:element name="roleAssignment" type="tns:roleAssignmentDataObj" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
 </xs:complexType>
</xs:element>

but which generates Java code as

protected ProjectDataObj.RoleAssignments roleAssignments;

I'm trying to get it generate

protected List<RoleAssignment> roleAssignments;

I've tried fiddling around with xjb binding for wsimport but that hasn't seemed to give me the control I want. Is there a way to do this?

役に立ちましたか?

解決

It turns out I needed to use a plug-in to XJC.

I used https://github.com/dmak/jaxb-xew-plugin. This plug-in will correctly generate the correct wrappers on the client side.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top