SkyWalking OAP 中的 FunctionCategory 类
@AllArgsConstructor
@Getter
public enum FunctionCategory {
METER("meter", MeterFunction.class),
METRICS("metrics", MetricsFunction.class);
private final String name;
private final Class<? extends Annotation> annotationClass;
// 省略部分代码
private static Annotation doGetAnnotation(Class<?> clazz, Class<? extends Annotation> annotationClass) {
if (clazz.equals(Object.class)) {
return null;
}
Annotation annotation = clazz.getAnnotation(annotationClass);
if (annotation != null) {
return annotation;
}
return doGetAnnotation(clazz.getSuperclass(), annotationClass);
}
}