从 JAX-WS 生成的 WSDL 中隐藏枚举元素
我有一个类似打击的枚举类。我正在使用 JAX-WS 生成 WSDL,但我想对客户端隐藏 DELETED 枚举。有办法做到这一点吗?我尝试了@XmlTransient,但不起作用。
@SuppressWarnings("restriction")
@XmlEnum(String.class)
public enum StatusEnum {
ACTIVE,
INACTIVE,
DELETED,
}
I have a enum class like blow. I'm using JAX-WS to generate WSDL, but I want to hide the DELETED enum from the client. Is there a way to do that? I tried @XmlTransient, but doen't work.
@SuppressWarnings("restriction")
@XmlEnum(String.class)
public enum StatusEnum {
ACTIVE,
INACTIVE,
DELETED,
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从我的角度来看,如果您出于某种原因想要对客户端隐藏一些枚举条目,那么实际上有两个枚举,它们本质上是不同的 - “内部”和“客户端”。您可以在枚举代码中轻松地从另一个生成一个:
From my point of view, if you for some reasons want to hide some enum entries from the client, then there are actually two enums, which are different by nature - "internal" and "client side". You can easily produce one from another right in your enum code: