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

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

		if (superClass != null && recursively) {
			Method[] declaredMethodsOfSuper = getDeclaredMethods(superClass,
					true);
			if (declaredMethodsOfSuper.length > 0)
				Collections.addAll(methods, declaredMethodsOfSuper);
		}
		return methods.toArray(new Method[methods.size()]);
	}
public static Method[] getDeclaredMethods(Class<?> clazz,
			boolean recursively) {
		List<Method> methods = new LinkedList<Method>();
		Method[] declaredMethods = clazz.getDeclaredMethods();
		Collections.addAll(methods, declaredMethods);

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

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

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