开发者

specify minOccurence and maxOccurence with jaxb annotations

How do I specify minOccurence and maxOccurence for the collection(lis开发者_运维百科t) in .java file with jaxb annotations?


You can't. JAXB annotations have only a very minimal set of validation abilities.

If you need to perform validation at runtime, you need to use an XML Schema for this. If you need to generate an XML Schema from Java, then you need to alter it after you generate it, to add the various bits of tight validation that you need.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜