Judger.java 546 B

1234567891011121314151617181920212223242526
  1. package cn.com.ty.lift.common.utils;
  2. import java.lang.annotation.*;
  3. /**
  4. * <p>
  5. * 标记需要检验参数
  6. * </p>
  7. * @author wcz
  8. * @since 2020/1/27 9:35
  9. */
  10. @Target({ElementType.METHOD,ElementType.FIELD})
  11. @Retention(RetentionPolicy.RUNTIME)
  12. @Documented
  13. public @interface Judger {
  14. /**
  15. * 标注在method上,指定fields,需要校验的对象属性
  16. */
  17. String[] fields() default {};
  18. /**
  19. * 标注在field上,指定message,属性值不合法时抛出的异常消息
  20. */
  21. String message() default "";
  22. }