JavaType.java 文件源码

java
阅读 66 收藏 0 点赞 0 评论 0

项目:listing 作者:
/** 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;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号