Thomas Breuer, Eurofins Medigenomix schrieb:
> Hi Christian,
>
> What would you think about implementing a superclass-copy-constructor
> generator too?
[...]
>
> /** superclass copy-constuctor */
>
> Son(Dad d) {
>
> // copy everything from superclass...
>
> }
>
> }
>
> Would be very helpful when working with multilayer class hierarchies.
> Perhaps it would be easy to implement into cc-xjc ???
>
> Best,
>
> Thomas
Hi,
in that superclass-copy-constructor, the properties of the class 'Son'
should not be touched at all and left to theire defaults ? So that the
constructor would actually look like:
Son(Dad d)
{
super(d);
}
What when there is more than one superclass ?
Root
^
|
Parent
^
|
Child
Should there be a super-superclass-constructor as well ?
Child(Child o)
{
super(o);
// copy properties of child.
}
Child(Parent o)
{
super(o);
}
Child(Root o)
{
super(o);
}
--
Christian
|