org.conductor.util.ReflectionUtil Maven / Gradle / Ivy
package org.conductor.util;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class ReflectionUtil {
public static List getMethodsAnnotatedWith(final Class> type, final Class extends Annotation> annotation) {
final List methods = new ArrayList();
final List allMethods = new ArrayList(Arrays.asList(type.getDeclaredMethods()));
for (final Method method : allMethods) {
if (method.isAnnotationPresent(annotation)) {
methods.add(method);
}
}
return methods;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy