JSR 303 - Bean Validation

Bean Validation of constraint A
Bean Validation built-in constraint A
@null annotated element must be null
@NotNull annotated element must not be null
@AssertTrue annotated element must be to true
@AssertFalse annotated element must be false
@min (value) annotated element must be a number whose value must be greater than the specified minimum
@max (value) annotated element must be a number whose value is equal to the specified maximum value must be less than
@DecimalMin (value) is element annotation must be a number whose value must be greater than the specified minimum
@DecimalMax (value) annotated element must be a number whose value is equal to the specified maximum value must be less than
@Size (max, min) is annotated size of the element must be within the specified range
@Digits (integer, fraction) annotated element must be a number whose value must be within an acceptable range
@Past annotated element must be a date in the past
@Future annotated the element must be a future date
@Pattern (value) The element being annotated must meet the specified regular expression

Hibernate Validator additional constraint
@email annotated element must be the email address
@Length string must be annotated within the specified size range
@NotEmpty string is non-empty comment must
@Range annotated element must suitable within the scope of

Published 45 original articles · won praise 1 · views 1044

Guess you like

Origin blog.csdn.net/lqq404270201/article/details/104673042