在 JAXB 中设置 XML 属性正则表达式模式?
有没有办法通过注释以某种方式在 @XmlAttribute
上指定正则表达式模式?除了通过外部模式进行验证之外,还有其他方法可以做到这一点吗?
Is there a way to specify a regular expression pattern on an @XmlAttribute
somehow through annotations? Is there a way of doing this besides validation through an external schema?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 JSR-303 的实现,它提供注释和 XML 配置文件来指定 bean 验证规则:
You could use an implementation of JSR-303 which provides both annotations and an XML config file for specifying rules for bean validation: