src/main/java/com/rockagen/commons/util/ClassUtil.java
public static Constructor<?>[] getDeclaredConstructors(Class<?> clazz,
			boolean recursively) {
		List<Constructor<?>> constructors = new LinkedList<Constructor<?>>();
		Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors();
		Collections.addAll(constructors, declaredConstructors);

		Class<?> superClass = clazz.getSuperclass();

		if (superClass != null && recursively) {
			Constructor<?>[] declaredConstructorsOfSuper = getDeclaredConstructors(
					superClass, true);
			if (declaredConstructorsOfSuper.length > 0)
				Collections.addAll(constructors, declaredConstructorsOfSuper);
		}
		return constructors.toArray(new Constructor<?>[constructors.size()]);
	}
public static Constructor<?>[] getDeclaredConstructors(Class<?> clazz,
			boolean recursively) {
		List<Constructor<?>> constructors = new LinkedList<Constructor<?>>();
		Constructor<?>[] declaredConstructors = clazz.getDeclaredConstructors();
		Collections.addAll(constructors, declaredConstructors);

		Class<?> superClass = clazz.getSuperclass();

		if (superClass != null && recursively) {
			Constructor<?>[] declaredConstructorsOfSuper = getDeclaredConstructors(
					superClass, true);
			if (declaredConstructorsOfSuper.length > 0)
				Collections.addAll(constructors, declaredConstructorsOfSuper);
		}
		return constructors.toArray(new Constructor<?>[constructors.size()]);
	}
public static Constructor < ? > [ ] getDeclaredConstructors ( Class < ? > clazz , boolean recursively ) { List < Constructor < ? > > constructors = new LinkedList < Constructor < ? > > ( ) ; Constructor < ? > [ ] declaredConstructors = clazz . getDeclaredConstructors ( ) ; Collections . addAll ( constructors , declaredConstructors ) ; Class < ? > superClass = clazz . getSuperclass ( ) ; if ( superClass != null && recursively ) { Constructor < ? > [ ] declaredConstructorsOfSuper = getDeclaredConstructors ( superClass , true ) ; if ( declaredConstructorsOfSuper . length > 0 ) Collections . addAll ( constructors , declaredConstructorsOfSuper ) ; } return constructors . toArray ( new Constructor < ? > [ constructors . size ( ) ] ) ; }
obtain constructor list of specified class If recursively is true, obtain
constructor from all class hierarchy


@param clazz class
where fields are searching
@param recursively
param
@return array of constructors
obtain constructor list of specified class If recursively is true obtain constructor from all class hierarchy