Here you can find the source of getConstructors(Class
public static <T> List<Constructor<T>> getConstructors(Class<T> clazz, int modifier)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<Constructor<T>> getConstructors(Class<T> clazz, int modifier) { Constructor<?>[] constructors = clazz.getDeclaredConstructors(); List<Constructor<T>> ret = new ArrayList<Constructor<T>>(constructors.length); for (Constructor<?> constructor : constructors) { if ((modifier & constructor.getModifiers()) != 0) { @SuppressWarnings("unchecked") Constructor<T> c = (Constructor<T>) constructor; ret.add(c);/* w w w .j a v a 2 s . co m*/ } } return ret; } }