-
Notifications
You must be signed in to change notification settings - Fork 26.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
增加MethodValidated注解的测试用例 及对MethodValidated使用场景和用法的说明注释 (#784)
* 增加MethodValidated注解的测试用例 及对MethodValidated使用场景和用法的说明注释 * 将需要检查的分组维护到List<Class<?>> groups中,包括当前接口类及Default.class两个默认的分组 * 修改接口级别为jdk1.6; 按javadoc规范修改注释
- Loading branch information
1 parent
50d4ddd
commit 1420cb4
Showing
6 changed files
with
114 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...r/dubbo-filter-validation/src/main/java/com/alibaba/dubbo/validation/MethodValidated.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.alibaba.dubbo.validation; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* 方法分组验证注解 | ||
* <p>使用场景:当调用某个方法时,需要检查多个分组,可以在接口方法上加上该注解</p><br> | ||
* 用法:<pre> @MethodValidated({Save.class, Update.class}) | ||
* void relatedQuery(ValidationParameter parameter);</pre> | ||
* 在接口方法上增加注解,表示relatedQuery这个方法需要同时检查Save和Update这两个分组 | ||
* | ||
* @author: zhangyinyue | ||
*/ | ||
@Target({ElementType.METHOD}) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface MethodValidated { | ||
Class<?>[] value() default {}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters