Here you can find the source of getMethods(Object obj, boolean hasParent)
public static Method[] getMethods(Object obj, boolean hasParent) throws Exception
//package com.java2s; //License from project: Apache License import java.lang.reflect.Method; public class Main { public static Method[] getMethods(Object obj, boolean hasParent) throws Exception { if (isEmpty(obj)) { return null; }//from w w w. j ava 2 s . co m if (hasParent) return obj.getClass().getMethods(); return obj.getClass().getDeclaredMethods(); } public static boolean isEmpty(Object obj) throws Exception { return obj == null; } }