public static List getMethodsAnnotatedWith()

in hugegraph-common/src/main/java/org/apache/hugegraph/util/ReflectionUtil.java [47:62]


    public static List<Method> getMethodsAnnotatedWith(
                               Class<?> type,
                               Class<? extends Annotation> annotation,
                               boolean withSuperClass) {
        final List<Method> methods = new LinkedList<>();
        Class<?> klass = type;
        do {
            for (Method method : klass.getDeclaredMethods()) {
                if (method.isAnnotationPresent(annotation)) {
                    methods.add(method);
                }
            }
            klass = klass.getSuperclass();
        } while (klass != Object.class && withSuperClass);
        return methods;
    }