users@jaxb.java.net

Re: xjc: how to make a class implement Serialiazable without changing the schema?

From: Dmitri Colebatch <colebatchd_at_gmail.com>
Date: Wed, 1 Jun 2005 13:09:47 +1000

Thanks a heap, that worked fine.

cheers
dim

On 6/1/05, Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_sun.com> wrote:
> Dmitri Colebatch wrote:
> > Hi all,
> >
> > I want to use xjc to generate java classes for 3rd party schemas - as
> > such I don't have control over the schemas and would like to avoid
> > having to xslt them in order to have the generated classes implement
> > Serializable.
> >
> > Is it possible to direct xjc to make all generated classes implement
> > the Serializable interface without changing the schemas?
>
> Yes. The customization to do this is:
>
> <jaxb:globalBindings>
> <jaxb:serializable/>
> </jaxb:globalBindings>
>
> And you can use external customizations to set this outside the schema
> file. See one of the bundled sample applications for how to use external
> customizations. (I think I also blogged recently about to how to use
> external binding files quickly, although I used different customizations
> [1].)
>
>
> [1]
> http://weblogs.java.net/blog/kohsuke/archive/2005/05/compiling_mathm_1.html
> --
> Kohsuke Kawaguchi
> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>
>
>