users@jaxb.java.net

Re: questions about managing multi versions of JAXB classes

From: Christophe Alexandre <alexandre_at_magillem.com>
Date: Tue, 10 Jul 2007 20:31:21 +0200

Hi all,

I've tried to extend manually a JAXB (2.1) generated class with one
of my classes, but an exception occurs when I try to marshall my schema.
The problem comes from my extended classes in which there are some
accessors to JAXB (2.1) generated objects from another schema.

Is there a special annotation (in JAXB 2.1) to add with the extends
to make the marshaller ignore the extended classes ?

This works fine with JAXB 1.0 .

Regards.
Christophe



Le 29 juin 07 à 00:01, KennyMacLeod a écrit :

> With JAXB2, you could write a XJC plugin that made your classes
> implement your own interfaces or extend your own classes, to make
> them conform to your version-neutral type interface. With JAXB1,
> though, I don't know if there's a way to achieve the same thing.
>
>
> Christophe Alexandre wrote:
>> Hi all,
>> I'm using JAXB 1.5 and I'm looking for feedback on how to manage
>> different JAXB classes generated from several .xsd versions.
>> My main problem is that I must manage a huge .xsd schema and that
>> I must manage at the same time several versions of it. I also know
>> that in the future I will have new versions
>> of this schema.
>> There are differences between the different versions but the heart
>> of the schema remains the same.
>> So I created a set of abstract classes and I have edited the JAXB
>> classes to make them extend these abstract classes.
>> This permits me to declare abstract methods in my abstract
>> classes, which I know are implemented by the JAXB classes.
>> Maybe, I'm not very clear here, but this permits me to keep the
>> heart of my system without loosing it each time I regenerate new
>> JAXB classes
>> and to develop functions on top of my system independent of the
>> version.
>> Is this an heresy ?
>> Is there a way I can make some of the generated JAXB classes
>> extend automatically my classes during the generation ?
>> Is this kind of mechanism possible with JAXB 2.1 ?
>> Did someone face the same kind of problematic ?
>> Thanks for any feedback...
>> Regards.
>> Christophe
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>