users@jaxb.java.net

xjc:serializable in external binding file

From: Dave Woolaway <dave.j.woolaway_at_BRITISHAIRWAYS.COM>
Date: Thu, 19 Jun 2003 06:07:12 -0600

I'm trying to define xjc:serializable for my generated classes
in an external binding file and am not getting it to work.

I've gone back to the example in samples/vendor-extensions which
defines the binding customisations inline (which works) and modified
it as below to use an external file - however it doesn't then
apply the customisations (no Serializable & no superclass). So I'm
missing something - but I can't see what - any suggestions?

Thanks a lot,
Dave Woolaway

build.xml modified like this:

<xjc extension="true" schema="po.xsd" target="."
     package="primer.myPo" binding="po.xjb"/>


po.xsd is modified to remove all jaxb references so looks like:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
...etc


po.xjb looks like this:

<jaxb:bindings version="1.0"
              xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
              jaxb:extensionBindingPrefixes="xjc">

<jaxb:bindings schemaLocation="po.xsd" node="/xsd:schema">
      <jaxb:globalBindings>
        <xjc:serializable uid="1"/>
        <xjc:superClass name="primer.BaseClass"/>
      </jaxb:globalBindings>
</jaxb:bindings>

</jaxb:bindings>