在Java中,常用的Validator驗證注解包括:
1. @NotNull:驗證對象是否為null;
2. @NotEmpty:驗證字符串不為null且長度大于0;
3. @NotBlank:驗證字符串不為null且去除首尾空格后長度大于0;
4. @Min(value):驗證數字是否大于等于指定最小值;
5. @Max(value):驗證數字是否小于等于指定最大值;
6. @DecimalMin(value):驗證BigDecimal、BigInteger等數字類型是否大于等于指定值;
7. @DecimalMax(value):驗證BigDecimal、BigInteger等數字類型是否小于等于指定值;
8. @Size(min =, max =):驗證集合或數組元素個數是否在指定范圍內;
9. @Email:驗證字符串是否為有效的郵件地址格式;
10. @Pattern(regexp =):驗證字符串是否符合指定的正則表達式。
此外,還有一些擴展注解,可以滿足更具體的驗證需求,比如@Valid,@AssertTrue,@AssertFalse等等。
- 環境配置
- window怎么配置java環境變量?
- Java基礎語法
- Java中的數據類型
- Java中的JSONObject
- Java高級特性
- Maven
- jib-maven-plugin
- 什么是Spring Boot 的 parent pom?
- maven中各個生命周期的含義
- Spring Boot
- maven與spring boot 的關系
- 配置文件
- application-properties配置文件
- Spring Boot 的啟動
- spring boot項目如何啟動?
- 列舉一下Spring Boot的啟動過程
- SpringApplication.run方法
- Spring Boot 啟動時有哪些接口?
- CommandLineRunner
- Spring Boot 的常用注解
- 系統注解
- 表格:系統注解
- @Override
- @Deprecated
- @SuppressWarnnings
- 使用在類名上的注解
- 表格:使用在類名上的注解
- @RestController
- @Controller
- @Service
- @Repository
- @Component
- @Configuration
- @Resource
- @Autowired
- @RequestMapping
- @PostMapping
- @GetMapping
- @Transactional
- @Qualifier
- 使用在方法上的注解
- 表格:使用在方法上的注解
- @RequestBody
- @PathVariable
- @Bean
- @ResponseBody
- @PreAuthorize
- 其他常用注解
- 表格:其他常用注解
- @EnableAutoConfiguration
- @SpringBootApplication
- @EnableScheduling
- @EnableAsync
- @ComponentScan
- @Aspec
- @ControllerAdvice
- @ExceptionHandler
- @Value
- @ConfigurationProperties
- @EnableConfigurationProperties
- @MapperScan
- Validator驗證的常用注解
- spring IoC容器
- Spring IoC容器依賴注入實現方式
- MyBatis
- paginationInterceptor
- @TableName
- @TableId
- @Param
- UrlBasedCorsConfigurationSource
- Lombok
- @Data
- @Slf4j
- @EqualsAndHashCode
- @Accessors
- 支付系統
- 1. 初始化mysql數據庫流程
- 2. 初始化redis數據庫的流程
- 3. 初始化rabbitmq服務