users@jaxb.java.net

Re: How to use subclasses of JAXB created classes

From: William Saxton <saxton_at_gmail.com>
Date: Thu, 14 Jun 2007 10:37:32 -0400

Do you have a link to that? I'm don't see anything here:

https://jaxb2-commons.dev.java.net/

I did find this though. Do you think this would be a good approach?:

https://jaxb2-commons.dev.java.net/simple-regenerator/

On 6/14/07, Aleksei Valikov <valikov_at_gmx.net> wrote:
>
> Hi.
>
> I have a bunch of JAXB created classes, FooData, BarData, etc. Using
> > the "Strategy pattern" I want each class to have a method, pair(), that will
> > return a list of key/value pairs.
> >
> > My first thought was to create classes, such as SuperFooData,
> > SuperBarData, etc, which extended FooData, BarData and implemented
> > Pairable. The problem with this approach, is that it is fairly difficult to
> > marshall data from XML into a subclass.
>
>
> Take a look at "copyable" plugin from jaxb2-commons/basic. It is capable
> of generating method like:
>
> public Object copyTo(Object target);
>
> You could the copy data from classes to subclasses.
>
> Bye.
> /lexi
>