The list of methods to do Reflection Method Return are organized into topic(s).
Method
getMethod(Class> clazz, String name, String returnType, String[] args) get Method
Method[] methods = clazz.getDeclaredMethods();
MainLoop: for (Method method : methods) {
if (name != null && !name.equals(method.getName())) {
continue;
if (returnType != null && !returnType.equals(method.getReturnType().getName())) {
continue;
if (args != null) {
Class<?>[] args2 = method.getParameterTypes();
if (args2.length != args.length) {
continue;
for (int count = 0; count < args.length; count++) {
if (!(args[count].equals(args2[count].getName()))) {
continue MainLoop;
return method;
return null;
Method
getMethod(Class> type, String name, Class> returnType, Class> paramType, boolean caseSensitive) Gets the public method within the type that matches the method name, return type, and single parameter type.
boolean methodNameFound = false;
Class<?> classType = type;
while (classType != null && !classType.equals(Object.class)) {
for (Method m : classType.getDeclaredMethods()) {
if ((!caseSensitive && m.getName().equalsIgnoreCase(name))
|| (caseSensitive && m.getName().equals(name))) {
methodNameFound = true;
if (returnType != null) {
...