@Null | 對象必須為null |
@NotNull | 對象必須不為null,無法檢查長度為0的字元串 |
@NotBlank | 字元串必須不為Null,且去掉前後空格長度必須大于0 |
@AssertTrue | 對象必須為true |
@AssertFalse | 對象必須為false |
@Max(Value) | 必須為數字,且小于或等于Value |
@Min(Value) | 必須為數字,且大于或等于Value |
@DecimalMax(Value) | 必須為數字( BigDecimal ),且小于或等于Value。小數存在精度 |
@DecimalMin(Value) | 必須為數字( BigDecimal ),且大于或等于Value。小數存在精度 |
@Digits(integer,fraction) | 必須為數字( BigDecimal ),integer整數精度,fraction小數精度 |
@Size(min,max) | 對象(Array、Collection、Map、String)長度必須在給定範圍 |
@Email | 字元串必須是合法郵件位址 |
@Past | Date和Calendar對象必須在目前時間之前 |
@Future | Date和Calendar對象必須在目前時間之後 |
@Pattern(regexp=“正則”) | String對象必須符合正規表達式 |