On Tue, 2010-04-27 at 14:51 +0100, Eoghan Glynn wrote:
Hey Mark,
Just scanned thru' at the codegen from schema branch, looking good.
One issue with JAXB is that the default generated code can be a little
unnatural. For example the accessor on the collections types are in the
singular rather than the plural, e.g. VMs.getVm() instead of
VMs.getVMs().
You can work around this with binding customization, e.g. in the above
example controlling the method naming using some inline annotations:
<xs:complexType name="VMs">
<xs:sequence>
+ <xs:annotation>
+ <xs:appinfo>
+ <jaxb:property name="VMs"/>
+ </xs:appinfo>
+ </xs:annotation>
<xs:element ref="vm" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
or alternatively if you don't want to pollute the schema with JAXB-isms,
these can be pushed out to a separate file.
Unfortunately there doesn't seem to be a customization to decorate the
generated code with an extra annotation (to add in the missing
@BadgerFish)
Patch attached with the inline changes for the schema and pom, but
obviously the code using these types would have to be updated also (not
again, says you!)
Nice one Eoghan - I'll use that, the default really sucks
Thanks,
Mark.