All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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 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