开发者

CXF: Cloneable classes from wsdl2java?

开发者 https://www.devze.com 2023-01-05 17:30 出处:网络
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 objec

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


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.


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)


Now I've implemented and contributed an XJC plugin that emits cloneable classes: https://issues.apache.org/jira/browse/CXF-3354

0

精彩评论

暂无评论...
验证码 换一张
取 消