Encodings.java 文件源码

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

项目:GitHub 作者:
private TypeExtractor processTypeParameters(ExecutableElement method, EncodedElement.Builder builder) {
  boolean isStatic = method.getModifiers().contains(Modifier.STATIC);

  TypeExtractor typesReader = isStatic
      ? new TypeExtractor(types, method)
      : this.typesReader;

  for (TypeParameterElement p : method.getTypeParameters()) {
    String name = p.getSimpleName().toString();
    ImmutableList<Defined> bounds = typesReader.getDefined(p.getBounds());
    if (!isStatic) {
      typesReader = typesReader.withParameter(name, bounds);
    }
    builder.addTypeParams(new EncodedElement.TypeParam.Builder()
        .name(name)
        .addAllBounds(bounds)
        .build());
  }

  builder.typeParameters(typesReader.parameters);

  return typesReader;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号