Is it possible the generate shared objects using JAXB?

Posted by Peter Szanto on Stack Overflow See other posts from Stack Overflow or by Peter Szanto
Published on 2010-05-27T17:26:30Z Indexed on 2010/05/27 17:31 UTC
Read the original article Hit count: 231

Filed under:
|
|

I have 3 xsd files:

  • a.xsd
  • b.xsd
  • shared.xsd

shared.xsd is imported to both a.xsd and b.xsd using

<xs:import schemaLocation="shared.xsd"/>

shared.xsd defines

<xs:element name="item">
<xs:complexType> ....

If I generate java code using xjc a.xsd and b.xsd is generated into different packages and in each package a separate java class is generated for item. How would it be possible to have a single shared class for item and make a and b use it?

© Stack Overflow or respective owner

Related posts about java

Related posts about jaxb