这里使用的是:3.9 的版本,还是比较新的
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
</dependency>
这个工具类里面公共方法只有一个
isValidAnnotationMemberType(Class<?> type) 检测是否为有效的类型() 基本类型、枚举、注解、封装的String、Class
AnnotationUtils.isValidAnnotationMemberType(short.class); // 基本类型 true
AnnotationUtils.isValidAnnotationMemberType(SuppressWarnings.class); // 注解类型 true
AnnotationUtils.isValidAnnotationMemberType(ElementType.class); // ElementType(枚举类型) true
AnnotationUtils.isValidAnnotationMemberType(QcTemplate.class); // 其它引用类型 false