'javax.validation.constraints' package provides number of
annotations to do validations on data.
Below table summarizes the annotations provided by
JSR-380 specification.
Annotation
|
Description
|
The annotated element must be
false.
|
|
The annotated element must be true.
|
|
The annotated element must be a
number whose value must be lower or equal to the specified maximum.
|
|
The annotated element must be a
number whose value must be higher or equal to the specified minimum.
|
|
The annotated element must be a
number within accepted range Supported types are:
BigDecimal BigInteger CharSequence byte , short , int , long ,
and their respective wrapper types |
|
The string has to be a well-formed
email address.
|
|
Defines several
@Email constraints
on the same element. |
|
The annotated element must be an
instant, date or time in the future.
|
|
The annotated element must be an
instant, date or time in the present or in the future.
|
|
The annotated element must be a
number whose value must be lower or equal to the specified maximum.
|
|
The annotated element must be a
number whose value must be higher or equal to the specified minimum.
|
|
The annotated element must be a
strictly negative number (i.e.
|
|
The annotated element must be a
negative number or 0.
|
|
The annotated element must not
be
null and must contain at least one non-whitespace
character. |
|
Defines several
@NotBlank constraints
on the same element. |
|
The annotated element must not
be
null nor empty. |
|
Defines several
@NotEmpty constraints
on the same element. |
|
The annotated element must not
be
null . |
|
The annotated element must be
null . |
|
The annotated element must be an
instant, date or time in the past.
|
|
The annotated element must be an
instant, date or time in the past or in the present.
|
|
The annotated
CharSequence must match the specified regular expression. |
|
The annotated element must be a
strictly positive number (i.e.
|
|
The annotated element must be a
positive number or 0.
|
|
The annotated element size must be
between the specified boundaries (included).
|
|
No comments:
Post a Comment