private static void annotationTypeAnnotation() {
// @Target这个就是 此类型
ClassBinds classBinds = Test.class.getAnnotation(ClassBinds.class);
if (classBinds != null) {
Annotation[] annotations = classBinds.annotationType().getAnnotations();
Target target = classBinds.annotationType().getAnnotation(Target.class);
if (target != null)
System.out.print("ANNOTATION_TYPE---->targets:" );
for (ElementType elementType : target.value()) {
System.out.print("\t elementType:"+elementType);
}
System.out.println();
}
}
TestMain.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:JavaZone
作者:
评论列表
文章目录