手把手教你做网站做网站设计的都转行干啥了
news/
2025/9/24 17:26:23/
文章来源:
手把手教你做网站,做网站设计的都转行干啥了,怎么创建一个空壳公司,电子商务静态网页设计一、前言 spring为开发人员提供了两个搜索注解的工具类#xff0c;分别是AnnotatedElementUtils和AnnotationUtils。在使用的时候#xff0c;总是傻傻分不清#xff0c;什么情况下使用哪一个。于是我做了如下的整理和总结。 二、AnnotationUtils官方解释 功能 用于处理注解分别是AnnotatedElementUtils和AnnotationUtils。在使用的时候总是傻傻分不清什么情况下使用哪一个。于是我做了如下的整理和总结。 二、AnnotationUtils官方解释 功能 用于处理注解处理元注解桥接方法编译器为通用声明生成以及超级方法用于可选注解继承的常规实用程序方法。请注意JDK的内省工具本身并不提供此类的大多数功能。作为运行时保留注解的一般规则例如用于事务控制授权或服务公开始终在此类上使用查找方法例如findAnnotationMethodClassgetAnnotationMethodClass和getAnnotations方法而不是JDK中的普通注解查找方法。您仍然可以在给定类级别的get查找getAnnotationMethodClass和给定方法的整个继承层次结构中的查找查找findAnnotationMethodClass之间明确选择。 术语 直接呈现间接呈现和呈现的术语与AnnotatedElement的类级别javadoc中定义的含义相同在Java 8中。如果注解被声明为元素上存在的其他注解上的元注解则注解在元素上是元存在的。如果A在另一个注解上直接存在或元存在则注解A在另一个注解上存在元。 元注解支持 大多数find *方法和此类中的一些get *方法都支持查找用作元注解的注解。有关详细信息请参阅此类中每个方法的javadoc。对于在组合注解中使用属性覆盖的元注解的细粒度支持请考虑使用AnnotatedElementUtils的更具体的方法。 属性别名 此类中返回注解注解数组或AnnotationAttributes的所有公共方法都透明地支持通过AliasFor配置的属性别名。有关详细信息请参阅各种synthesizeAnnotation *..方法。 搜索范围 一旦找到指定类型的第一个注解此类中的方法使用的搜索算法将停止搜索注解。因此将默默忽略指定类型的其他注解。 三、AnnotatedElementUtils官方解释 功能 用于在AnnotatedElements上查找注解元注解和可重复注解的常规实用程序方法。AnnotatedElementUtils为Spring的元注解编程模型定义了公共API并支持注解属性覆盖。如果您不需要支持注解属性覆盖请考虑使用AnnotationUtils。请注意JDK的内省工具本身不提供此类的功能。 注解属性覆盖 getMergedAnnotationAttributesgetMergedAnnotationgetAllMergedAnnotationsgetMergedRepeatableAnnotationsfindMergedAnnotationAttributesfindMergedAnnotationfindAllMergedAnnotations和findMergedRepeatableAnnotations的所有变体都支持组合注解中带有属性覆盖的元注解的方法。 查找与获取语义 获取语义Get semantics仅限于搜索AnnotatedElement上存在的注解即本地声明或继承或在AnnotatedElement上方的注解层次结构中声明的注解。 查找语义Find semantics更加详尽提供了语义加上对以下内容的支持 如果带注解的元素是类则在接口上搜索如果带注解的元素是类则在超类上搜索解析桥接方法如果带注解的元素是方法如果带注解的元素是方法则在接口中搜索方法如果带注解的元素是方法则在超类中搜索方法 支持Inherited get语义之后的方法将遵循Java的Inherited批注的约定除了本地声明的注解包括自定义组合注解将优于继承注解。相反查找语义之后的方法将完全忽略Inherited的存在因为查找搜索算法手动遍历类型和方法层次结构从而隐式支持注解继承而不需要Inherited。 四、准备两个测试的注解 Target({ElementType.METHOD, ElementType.TYPE})
Retention(RetentionPolicy.RUNTIME)
Documented
interface RequestMapping {String name() default ;AliasFor(path)String[] value() default {};AliasFor(value)String[] path() default {};
}Target({ElementType.METHOD, ElementType.TYPE})
Retention(RetentionPolicy.RUNTIME)
Documented
RequestMapping
interface PostMapping {AliasFor(annotation RequestMapping.class)String name() default ;AliasFor(annotation RequestMapping.class)String[] value() default {};AliasFor(annotation RequestMapping.class)String[] path() default {};
} 五、测试例子 父类拥有注解RequestMapping子类没有注解 public class AnnotationTest {public static void main(String[] args) {System.out.println(ParentController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ChildController.class, RequestMapping.class));System.out.println();System.out.println(ParentController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ParentController.class, RequestMapping.class));System.out.println(ParentController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ChildController.class, RequestMapping.class));System.out.println();System.out.println(ParentController isAnnotated RequestMapping: AnnotatedElementUtils.isAnnotated(ParentController.class, RequestMapping.class));System.out.println(ParentController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController isAnnotated RequestMapping: AnnotatedElementUtils.isAnnotated(ChildController.class, RequestMapping.class));System.out.println(ChildController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ChildController.class, RequestMapping.class));System.out.println();System.out.println(ParentController hasAnnotation RequestMapping: AnnotatedElementUtils.hasAnnotation(ParentController.class, RequestMapping.class));System.out.println(ParentController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController hasAnnotation RequestMapping: AnnotatedElementUtils.hasAnnotation(ChildController.class, RequestMapping.class));System.out.println(ChildController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ChildController.class, RequestMapping.class));}
}RequestMapping(value parent/controller)
class ParentController {
}class ChildController extends ParentController {
} 输出结果如下。 ParentController getAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ChildController getAnnotation RequestMapping: nullParentController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ChildController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])ParentController isAnnotated RequestMapping: true
ParentController getMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ChildController isAnnotated RequestMapping: false
ChildController getMergedAnnotation RequestMapping: nullParentController hasAnnotation RequestMapping: true
ParentController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ChildController hasAnnotation RequestMapping: true
ChildController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller]) 父类没有注解子类拥有注解RequestMapping 输出结果如下。 ParentController getAnnotation RequestMapping: null
ChildController getAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])ParentController findAnnotation RequestMapping: null
ChildController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])ParentController isAnnotated RequestMapping: false
ParentController getMergedAnnotation RequestMapping: null
ChildController isAnnotated RequestMapping: true
ChildController getMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])ParentController hasAnnotation RequestMapping: false
ParentController findMergedAnnotation RequestMapping: null
ChildController hasAnnotation RequestMapping: true
ChildController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller]) 父类拥有注解PostMapping子类没有注解 public class AnnotationTest {public static void main(String[] args) {System.out.println(ParentController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ChildController.class, RequestMapping.class));System.out.println(ParentController getAnnotation PostMapping: AnnotationUtils.getAnnotation(ParentController.class, PostMapping.class));System.out.println(ChildController getAnnotation PostMapping: AnnotationUtils.getAnnotation(ChildController.class, PostMapping.class));System.out.println();System.out.println(ParentController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ParentController.class, RequestMapping.class));System.out.println(ParentController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ChildController.class, RequestMapping.class));System.out.println(ParentController findAnnotation PostMapping: AnnotationUtils.findAnnotation(ParentController.class, PostMapping.class));System.out.println(ParentController findAnnotation PostMapping: AnnotationUtils.findAnnotation(ChildController.class, PostMapping.class));System.out.println();System.out.println(ParentController isAnnotated RequestMapping: AnnotatedElementUtils.isAnnotated(ParentController.class, RequestMapping.class));System.out.println(ParentController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ParentController isAnnotated PostMapping: AnnotatedElementUtils.isAnnotated(ParentController.class, PostMapping.class));System.out.println(ParentController getMergedAnnotation PostMapping: AnnotatedElementUtils.getMergedAnnotation(ParentController.class, PostMapping.class));System.out.println(ChildController isAnnotated RequestMapping: AnnotatedElementUtils.isAnnotated(ChildController.class, RequestMapping.class));System.out.println(ChildController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ChildController.class, RequestMapping.class));System.out.println(ChildController isAnnotated PostMapping: AnnotatedElementUtils.isAnnotated(ChildController.class, PostMapping.class));System.out.println(ChildController getMergedAnnotation PostMapping: AnnotatedElementUtils.getMergedAnnotation(ChildController.class, PostMapping.class));System.out.println();System.out.println(ParentController hasAnnotation RequestMapping: AnnotatedElementUtils.hasAnnotation(ParentController.class, RequestMapping.class));System.out.println(ParentController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ParentController hasAnnotation PostMapping: AnnotatedElementUtils.hasAnnotation(ParentController.class, PostMapping.class));System.out.println(ParentController findMergedAnnotation PostMapping: AnnotatedElementUtils.findMergedAnnotation(ParentController.class, PostMapping.class));System.out.println(ChildController hasAnnotation RequestMapping: AnnotatedElementUtils.hasAnnotation(ChildController.class, RequestMapping.class));System.out.println(ChildController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ChildController.class, RequestMapping.class));System.out.println(ChildController hasAnnotation PostMapping: AnnotatedElementUtils.hasAnnotation(ChildController.class, PostMapping.class));System.out.println(ChildController findMergedAnnotation PostMapping: AnnotatedElementUtils.findMergedAnnotation(ChildController.class, PostMapping.class));}
}PostMapping(value parent/controller)
class ParentController {
}class ChildController extends ParentController {
} 输出结果如下。 ParentController getAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[], path[])
ChildController getAnnotation RequestMapping: null
ParentController getAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])
ChildController getAnnotation PostMapping: nullParentController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[], path[])
ChildController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[], path[])
ParentController findAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])
ChildController findAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])ParentController isAnnotated RequestMapping: true
ParentController getMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ParentController isAnnotated PostMapping: true
ParentController getMergedAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])
ChildController isAnnotated RequestMapping: false
ChildController getMergedAnnotation RequestMapping: null
ChildController isAnnotated PostMapping: false
ChildController getMergedAnnotation PostMapping: nullParentController hasAnnotation RequestMapping: true
ParentController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ParentController hasAnnotation PostMapping: true
ParentController findMergedAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])
ChildController hasAnnotation RequestMapping: true
ChildController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ChildController hasAnnotation PostMapping: true
ChildController findMergedAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller]) 父类没有注解子类拥有注解PostMapping 输出结果如下。 ParentController getAnnotation RequestMapping: null
ChildController getAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[], path[])
ParentController getAnnotation PostMapping: null
ChildController getAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])ParentController findAnnotation RequestMapping: null
ChildController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[], path[])
ParentController findAnnotation PostMapping: null
ChildController findAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])ParentController isAnnotated RequestMapping: false
ParentController getMergedAnnotation RequestMapping: null
ParentController isAnnotated PostMapping: false
ParentController getMergedAnnotation PostMapping: null
ChildController isAnnotated RequestMapping: true
ChildController getMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ChildController isAnnotated PostMapping: true
ChildController getMergedAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller])ParentController hasAnnotation RequestMapping: false
ParentController findMergedAnnotation RequestMapping: null
ParentController hasAnnotation PostMapping: false
ParentController findMergedAnnotation PostMapping: null
ChildController hasAnnotation RequestMapping: true
ChildController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[parent/controller], path[parent/controller])
ChildController hasAnnotation PostMapping: true
ChildController findMergedAnnotation PostMapping: com.hjzgg.apigateway.test.service.main.PostMapping(name, value[parent/controller], path[parent/controller]) PostMapping 注有 RequestMappingAnnotationUtils和AnnotatedElementUtils区别 public class AnnotationTest {public static void main(String[] args) {System.out.println(ParentController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ChildController.class, RequestMapping.class));System.out.println(ParentController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ChildController.class, RequestMapping.class));System.out.println();System.out.println(ParentController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ChildController.class, RequestMapping.class));System.out.println(ParentController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ChildController.class, RequestMapping.class));}
}RequestMapping(name parent, pathparent/controller)
class ParentController {
}PostMapping(namechild, value child/controller, consume application/json)
class ChildController extends ParentController {
}Target({ElementType.METHOD, ElementType.TYPE})
Retention(RetentionPolicy.RUNTIME)
Documented
interface RequestMapping {String name() default ;AliasFor(path)String[] value() default {};AliasFor(value)String[] path() default {};String[] consume() default {};
}Target({ElementType.METHOD, ElementType.TYPE})
Retention(RetentionPolicy.RUNTIME)
Documented
RequestMapping
interface PostMapping {AliasFor(annotation RequestMapping.class)String name() default ;AliasFor(annotation RequestMapping.class)String[] value() default {};AliasFor(annotation RequestMapping.class)String[] path() default {};AliasFor(annotation RequestMapping.class)String[] consume() default ;
} 输出结果如下。 ParentController getAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController getAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[], path[], consume[])
ParentController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(name, value[], path[], consume[])ParentController getMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController getMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(namechild, value[child/controller], path[child/controller], consume[application/json])
ParentController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(namechild, value[child/controller], path[child/controller], consume[application/json]) PostMapping 和 RequestMapping各自独立AnnotationUtils和AnnotatedElementUtils区别 public class AnnotationTest {public static void main(String[] args) {System.out.println(ParentController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController getAnnotation RequestMapping: AnnotationUtils.getAnnotation(ChildController.class, RequestMapping.class));System.out.println(ParentController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController findAnnotation RequestMapping: AnnotationUtils.findAnnotation(ChildController.class, RequestMapping.class));System.out.println();System.out.println(ParentController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController getMergedAnnotation RequestMapping: AnnotatedElementUtils.getMergedAnnotation(ChildController.class, RequestMapping.class));System.out.println(ParentController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ParentController.class, RequestMapping.class));System.out.println(ChildController findMergedAnnotation RequestMapping: AnnotatedElementUtils.findMergedAnnotation(ChildController.class, RequestMapping.class));}
}RequestMapping(name parent, pathparent/controller)
class ParentController {
}PostMapping(namechild, value child/controller, consume application/json)
class ChildController extends ParentController {
}Target({ElementType.METHOD, ElementType.TYPE})
Retention(RetentionPolicy.RUNTIME)
Documented
interface RequestMapping {String name() default ;AliasFor(path)String[] value() default {};AliasFor(value)String[] path() default {};String[] consume() default {};
}Target({ElementType.METHOD, ElementType.TYPE})
Retention(RetentionPolicy.RUNTIME)
Documented
interface PostMapping {AliasFor(annotation RequestMapping.class)String name() default ;AliasFor(annotation RequestMapping.class)String[] value() default {};AliasFor(annotation RequestMapping.class)String[] path() default {};AliasFor(annotation RequestMapping.class)String[] consume() default ;
} 输出结果如下。 ParentController getAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController getAnnotation RequestMapping: null
ParentController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController findAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])ParentController getMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController getMergedAnnotation RequestMapping: null
ParentController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[])
ChildController findMergedAnnotation RequestMapping: com.hjzgg.apigateway.test.service.main.RequestMapping(nameparent, value[parent/controller], path[parent/controller], consume[]) 此时PostMapping没注有RequestMapping所以AnnotationUtis.getAnnotation()和AnnotatedElementUtils.getMergeAnnotation()方法获取RequestMapping信息为空对应的find*()方法获取到的都是父类RequestMapping信息。 六、相关方法解释 AnnotationUtils.getAnnotation 从提供的AnnotatedElement获取annotationType的单个Annotation其中注解在AnnotatedElement上存在或元存在。请注意此方法仅支持单级元注解。要支持任意级别的元注解请使用findAnnotationAnnotatedElementClass。 AnnotationUtils.findAnnotation 在提供的AnnotatedElement上查找annotationType的单个Annotation。如果注解不直接出现在提供的元素上则将搜索元注解。 AnnotatedElementUtils.isAnnotated 确定在提供的AnnotatedElement上或指定元素上方的注解层次结构中是否存在指定annotationType的注解。如果此方法返回true则getMergedAnnotationAttributes方法将返回非null值。 AnnotatedElementUtils.hasAnnotation 确定指定的annotationType的注解是否在提供的AnnotatedElement上或在指定元素上方的注解层次结构中可用。如果此方法返回true则findMergedAnnotationAttributes方法将返回非null值。 AnnotatedElementUtils.getMergedAnnotation 在提供的元素上方的注解层次结构中获取指定注解类型的第一个注解将注解的属性与注解层次结构的较低级别中的注解的匹配属性合并并将结果合成回指定注解类型的注解。完全支持AliasFor语义包括单个注解和注解层次结构。此方法委托给getMergedAnnotationAttributesAnnotatedElementClass和AnnotationUtils.synthesizeAnnotationMapClassAnnotatedElement。 AnnotatedElementUtils.findMergedAnnotation 在提供的元素上方的注解层次结构中查找指定注解类型的第一个注解将注解的属性与注解层次结构的较低级别中的注解的匹配属性合并并将结果合成回指定注解类型的注解。完全支持AliasFor语义包括单个注解和注解层次结构。 转载于:https://www.cnblogs.com/hujunzheng/p/9790588.html
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/916014.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!