Forcing Jaxb preference of union member type when compiling



I am compiling an XSD using xjc that includes the following type:



<xs:simpleType name="CPT-DateTime">
<xs:annotation>
<xs:appinfo>Can be specified as a integer number or as xs:dateTime</xs:appinfo>
</xs:annotation>
<xs:union memberTypes="xs:unsignedLong xs:dateTime"/>
</xs:simpleType>


The resulting classes that use this type are compiled with this element set as String, while I would prefer them to use XMLGregorianCalendar.


Is there a way to that would force xjc to pick the xs:dateTime member type over the String? I've seen how to do this for simple types but not unions.


No comments:

Post a Comment