blob: d6e61ab62aa46cf784b65786387cea63f4e8439b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// Copyright 2020 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.abicheck.collector;
import java.util.HashSet;
import java.util.Set;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
public class AnnotationCollector extends ClassVisitor {
private final Set<String> annotations = new HashSet<>();
public AnnotationCollector() {
super(Opcodes.ASM7);
}
@Override
public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) {
annotations.add(Type.getType(descriptor).getClassName());
return null;
}
public Set<String> getAnnotations() {
return annotations;
}
}
|