使用 xjc 简单绑定模式关闭复数名称

发布于 2025-01-06 18:04:04 字数 357 浏览 2 评论 0原文

我有一个 XSD,我不想更改它来解决我将在下面描述的问题。使用当前形式的 XSD,我遇到了没有生成 @XmlRootlement 的常见问题,并使用了 简单绑定模式解决方案被许多人指出来添加此注释。

不幸的是,这导致生成的代码中的一些对象名称变得复数(即列表/集合对象现在变成汽车而不是汽车或驴而不是驴),这是不可取的,因为我使用这些对象来绑定 CXF 中的传入请求。有没有办法使用简单绑定模式但禁用复数形式?

I have an XSD that I'd like to not change to solve the problem I'll describe below. With the XSD in it's current form, I ran into the common problem of no @XmlRootlement being generated, and used the simple binding mode solution pointed out by many to get this annotation added.

Unfortunately, this has caused some object names in the generated code to become pluralized (i.e. list/collection objects now become cars instead of car or donkies instead of donkey) which is not desirable as I'm using these objects to binding incoming requests in CXF. Is there anyway to use the simple binding mode but disable the pluralization?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文