I am using the value-constructor plugin (
https://jaxb2-commons.dev.java.net/value-constructor/) to generate
constructors. The order of the params is not what I have specified in my
xsd. In my xsd I have:
<xs:element name="localization">
<xs:complexType>
<xs:attribute name="locale"/>
<xs:attribute name="label"/>
...
And when I use the value-constructor plugin, it gives me the following
constructor
public Localization(String label, String locale) { ...}
I'm not sure how the plugin determines the order of arguments. Looking at
the java file that Jaxb creates without the plugin, label appears before
locale (not that this neccessarily means anything).
Basically what I want to accomplish is to control the order of the
constructor arguments. But since these are xml attributes, their order in an
xml file does not matter, so perhaps it's outside of the jaxb spec to have
any control over their ordering in the generated java code.
My questions are: does the value-constructor plugin control this order, or
does it get it from the jaxb impl? And if it gets it from the jaxb impl, can
the jaxb impl control the order?
Thanks
Lowell