Skip to content

Commit 8d705d6

Browse files
committed
✨ 添加注解校验处理器
1 parent c1d0fdb commit 8d705d6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.dianpoint.summer.validation.processor;
2+
3+
import com.dianpoint.summer.validation.ValidationResult;
4+
5+
import java.lang.annotation.Annotation;
6+
import java.lang.reflect.Field;
7+
import java.util.List;
8+
9+
/**
10+
* @author: congccoder
11+
* @email: congccoder@gmail.com | <a href="https://github.com/ccoderJava">github-homepage</a>
12+
* @date: 2025/5/20 19:30
13+
*/
14+
15+
public interface AnnotationProcessor {
16+
17+
/**
18+
* 判断处理器是否支持当前注解
19+
*
20+
* @param annotationType 注解类型
21+
* @return true or false
22+
*/
23+
boolean support(Class<? extends Annotation> annotationType);
24+
25+
/**
26+
* 对注解标记的目标对象进行校验,并且返回校验结果
27+
*
28+
* @param target 目标对象
29+
* @param field 属性
30+
* @param annotation 注解
31+
* @return 校验结果集合
32+
*/
33+
List<ValidationResult> process(Object target, Field field, Annotation annotation);
34+
}

0 commit comments

Comments
 (0)