简体   繁体   English

使用xjc生成bean时xsd的JAXB默认值

[英]JAXB default values from xsd when generating beans with xjc

When generating java beans from xsd files I would like to have the default values defined in the xsd file pre-set in the java beans as well. 从xsd文件生成Java Bean时,我也希望具有在Java Bean中预先设置的xsd文件中定义的默认值。 The unmarshalling process does not care about xsd defaults, therefore I need them set at source generation time. 解组过程不关心xsd默认值,因此我需要在源生成时设置它们。

Can this be done? 能做到吗? I'm using Maven with the xjcplugin. 我在xjcplugin中使用Maven。

您可以尝试使用CXF XJC默认插件JAXB2通用默认值插件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM