You can use an external binding file to rename the class generated from a complex type. Below is an example where the class corresponding to the complex type itemType
would be generated as Item
.
<jxb:bindings
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
version="2.1">
<jxb:bindings schemaLocation="your-schema.xsd">
<jxb:bindings node="//xs:complexType[@name='itemType']">
<jxb:class name="Item"/>
</jxb:bindings>
</jxb:bindings>
</jxb:bindings>
You specify the binding file in the XJC call using the -b
flag
xjc -b binding.xml your-schema.xsd