users@jaxb.java.net

Re: Set instead of List?

From: Farrukh Najmi <farrukh_at_wellfleetsoftware.com>
Date: Fri, 09 Dec 2011 13:57:58 -0500

Try customizations in attached file. Note I have not actually tried it
and you may need to tweek. You should rename it to bindings.xjb per
default conventions.

On 12/09/2011 11:01 AM, John G. Lussmyer wrote:
> Well, those docs do seem to imply it's possible, but darned if I can
> figure out the syntax needed.
>
> What I have is a <xs:complexType> that contains multiple elements.
> One element is:
> <xs:sequence>
> <xs:element name="ConsumerIdentifier" type="ConsumerIdentifier"
> minOccurs="1" maxOccurs="unbounded"/>
> </xs:sequence>
> What I want is for the get/setConsumerIdentifier() methods to use
> Set<ConsumerIdentifier> instead of List<ConsumerIdentifier>.
>
> Any suggestions on xsd syntax needed?
>
>
> On 12/9/2011 4:17 AM, Farrukh Najmi wrote:
>> On 12/08/2011 12:23 PM, cougar_at_casadelgato.com wrote:
>>> Is there any way to have the xsd defined java objects have a Set
>>> instead of a List?
>>>
>> You need to use a jaxb |collectionType |customization either globally
>> or for a specific property binding:
>>
>> http://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html
>>

-- 
Regards,
Farrukh Najmi
Web: http://www.wellfleetsoftware.com