# JfinalValidator **Repository Path**: totopto/JfinalValidator ## Basic Information - **Project Name**: JfinalValidator - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2018-12-19 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # JfinalValidator #### 介绍 基于Jfinal Jboot写的参数拦截器 由于不是通过传统的方式在bean 方法上配置参数规则,所以不存在反射而导致的性能问题 需要拦截的参数规则可以非常灵活 请参考MyRules的写法 ### 1.配置拦截器 public void onInterceptorConfig(Interceptors interceptors) { interceptors.add(new ValidatorInterceptor()); } ### 2.拦截标签 @Validator用于拦截参数 @Version用于拦截版本号 ### 3.配置拦截规则(配置在任意java bean上即可) @VRules(rules={ @VRule(attrName = "email", message="手机号码格式有误", groups = { Group.excutor }, types = { ValidatorType.MOBILE_PHONE} ) @VRule(attrName = "email", message="电子邮件格式有误", groups = { Group.excutor }, types = { ValidatorType.EMAIL } ) })