BytecodeBoundClass.java 文件源码

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

项目:turbine 作者:
@Override
public AnnotationMetadata get() {
  if ((access() & TurbineFlag.ACC_ANNOTATION) != TurbineFlag.ACC_ANNOTATION) {
    return null;
  }
  RetentionPolicy retention = null;
  ImmutableSet<ElementType> target = null;
  ClassSymbol repeatable = null;
  for (ClassFile.AnnotationInfo annotation : classFile.get().annotations()) {
    switch (annotation.typeName()) {
      case "Ljava/lang/annotation/Retention;":
        retention = bindRetention(annotation);
        break;
      case "Ljava/lang/annotation/Target;":
        target = bindTarget(annotation);
        break;
      case "Ljava/lang/annotation/Repeatable;":
        repeatable = bindRepeatable(annotation);
        break;
      default:
        break;
    }
  }
  return new AnnotationMetadata(retention, target, repeatable);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号