简体   繁体   中英

Is there a common constraint library for jsr 303 (Bean Validation)?

JSR 303 Bean Validation contains out of the box some constrains, but also allow to define custom constrains.

I have the feeling that there are a lot of constraints common for a lot of projects that are not shipped with the JSR implementations.

So my question is: Is there a (trustworthy) library that contains commons jsr 303 (Bean Validation) constraints?

I'm not aware of a dedicated constraint library, but the JSR 303 reference implementation Hibernate Validator provides several additional constraints , such as @Email , @ScriptAssert , @URL etc. (disclaimer: I'm contributing to Hibernate Validator).

If you have additional ideas or requirements for other constraints, feel free to create a feature request in our JIRA instance .

I came to the same result that there is no such library. So I decided to share my little set of common constraints and its validators: https://github.com/malkusch/validation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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