I need to generate many classes from my XML Schema (XSD) in a package (.jar). How can I configure these classes to be serializable?
(I'm using Eclipse and JAX-B)
I need to generate many classes from my XML Schema (XSD) in a package (.jar). How can I configure these classes to be serializable?
(I'm using Eclipse and JAX-B)
If you are using XJC, I recomend you to read this reference: JavaTM Architecture for XML Binding: JAXB RI Vendor Extensions Customizations :
You have to add in your schema aditional namespaces definition to add xjc aditional markup:
Then, including an
<xjc:serializable>
node within<jaxb:globalBindings>
:This will cause that all the concrete classes implement the Serializable interface. Also, you can define the UUID value of the resulting classes (that's an optional attribute).
I've found