views:

21

answers:

2

Hi,

Is it possible to have CXF's wsdl2java emit cloneable classes? Maybe via some option or a plug-in?

What I need to do is copy by value a rather complex schema structure from one object tree to another and would rather not get/set each member value by hand or touch the generated classes by hand.

/Björn

A: 

I would recommend you avoid Cloneable, and rather have the emitted classes be serializable and serialize and deserialize the class(es) to clone them. Here are some instructions on how to do that with CXF, although I never tried it myself.

Yishai
A: 

You COULD write an XJC plugin to do this. CXF does have a couple XJC plugins to do various things that you could use as a model. (and maybe submit back to CXF)

Daniel Kulp
That indeed occurred to me. If I understand things correctly then it should be enough to add _ implements Cloneable _ to each class.I haven't yet tried the serializing / deserializing way mentioned here...
Bjorn Thor Jonsson