/** Create {@link JavaType} based on {@link AnnotatedType} instance. */
public static JavaType of(AnnotatedType annotatedType) {
if (annotatedType instanceof AnnotatedArrayType) {
return JavaTypes.of((AnnotatedArrayType) annotatedType);
}
if (annotatedType instanceof AnnotatedParameterizedType) {
return JavaTypes.of((AnnotatedParameterizedType) annotatedType);
}
if (annotatedType instanceof AnnotatedTypeVariable) {
return JavaTypes.of((AnnotatedTypeVariable) annotatedType);
}
if (annotatedType instanceof AnnotatedWildcardType) {
return JavaTypes.of((AnnotatedWildcardType) annotatedType);
}
// default case: use underlying raw type
JavaType result = of(annotatedType.getType());
result.getAnnotations().addAll(Annotation.of(annotatedType.getAnnotations()));
return result;
}
JavaType.java 文件源码
java
阅读 40
收藏 0
点赞 0
评论 0
项目:listing
作者:
评论列表
文章目录