@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface B{
}
MethodSignature signature = (MethodSignature) pjp.getSignature();
if (signature.getMethod().isAnnotationPresent(B.class)) {
//意思就是:注释B是否在此A上。如果在则返回true;不在则返回false。
}
isAnnotationPresent()
最新推荐文章于 2023-01-20 19:10:46 发布