迭代查询全部方法，包括本类和父类

@param clazz 对象类
@return 所有字段列表
504656
public static List<Method> getAllMethods(Class clazz) {
        List<Method> all = new ArrayList<Method>();
        for (Class<?> c = clazz; c != Object.class && c != null; c = c.getSuperclass()) {
            Method[] methods = c.getDeclaredMethods(); // 所有方法，不包含父类
            for (Method method : methods) {
                int mod = method.getModifiers();
                // native的不要
                if (Modifier.isNative(mod)) {
                    continue;
                }
                method.setAccessible(true); // 不管private还是protect都可以
                all.add(method);
            }
        }
        return all;
    }
341775
public static List<Method> getAccessors(Class<?> clazz) {
    if (clazz == null) {
      throw new IllegalArgumentException("The 'clazz' parameter cannot be null.");
    }

    List<Method> methods = new ArrayList<>();
    for (Method method : clazz.getMethods()) {
      String methodName = method.getName();
      if (!"getClass".equals(methodName) && !"hashCode".equals(methodName) && method.getReturnType() != null
          && !Void.class.equals(method.getReturnType()) && method.getParameterTypes().length == 0
          && ((methodName.startsWith("get") && methodName.length() > 3)
              || (methodName.startsWith("is") && methodName.length() > 2)
              || (methodName.startsWith("has") && methodName.length() > 3))) {
        methods.add(method);
      }
    }

    // Order the methods alphabetically by name
    sort(methods, new Comparator<Method>() {
      /**
       * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
       */
      @Override
      public int compare(Method method1, Method method2) {
        return method1.getName().compareTo(method2.getName());
      }
    });

    return unmodifiableList(methods);
  }
840502
@SuppressWarnings("unchecked")
    public <T> List<T> getAnnotations(final Class<? extends Annotation> clazz) {
        return (List<T>) foundAnnotations.get(clazz);
    }
940658
public static String getByteCodeType(Class<?> clazz) {
        Assert.notNull(clazz);
        if (byte.class == clazz) {
            return "B";
        } else if (short.class == clazz) {
            return "S";
        } else if (int.class == clazz) {
            return "I";
        } else if (long.class == clazz) {
            return "J";
        } else if (double.class == clazz) {
            return "D";
        } else if (float.class == clazz) {
            return "F";
        } else if (boolean.class == clazz) {
            return "Z";
        } else if (char.class == clazz) {
            return "C";
        } else if (void.class == clazz) {
            // void只有在返回值中才会有
            return "V";
        } else if (StringUtils.trim(clazz.getName(), "[").startsWith("L")) {
            // 是对象数组（这里的对象指的是非原生类型）
            return clazz.getName().replace(".", "/");
        } else if (!JavaTypeUtil.isGeneralType(clazz)) {
            // 是对象（这里的对象指的是非原生类型）
            return "L" + clazz.getName().replace(".", "/") + ";";
        } else {
            return clazz.getName().replace(".", "/");
        }
    }
922802
public static Method getStaticMethod(final Class<?> clazz, final String methodName, final Class<?>... parameterTypes) {
		Asserts.notNull(clazz);
		for (Class<?> superClass = clazz; superClass != Object.class; superClass = superClass.getSuperclass()) {
			try {
				Method method = clazz.getDeclaredMethod(methodName, parameterTypes);
				method.setAccessible(true);
				return method;
			} catch (NoSuchMethodException | SecurityException e) {
				// Method不在当前类定义,继续向上转型
			}
		}
		return null;
	}
470364
public <T extends AbstractJaxb> boolean hasCssClass(String clazz) {
        boolean result = false;
        List<String> classList = this.getCssClass();
        if (classList != null && classList.contains(clazz)) {
            result = true;
        }
        return result;
    }
334676
@SuppressWarnings("unchecked")
    public <C extends Client> Optional<C> findClient(final Class<C> clazz) {
        CommonHelper.assertNotNull("clazz", clazz);
        init();
        if (clazz != null) {
            for (final Client client : getClients()) {
                if (clazz.isAssignableFrom(client.getClass())) {
                    return Optional.of((C) client);
                }
            }
        }
        LOGGER.debug("No client found for class: {}", clazz);
        return Optional.empty();
    }
1060241
public static Class<?>[] getAllSuperClasses(Class<?> clz) {
    List<Class<?>> list = new ArrayList<>();
    while ((clz = clz.getSuperclass()) != null) {
      list.add(clz);
    }
    return list.toArray(new Class<?>[list.size()]);
  }
582128
public Config getConfig(Class<?> clazz) {
        Config config = DEFAULT_CONFIG;

        Config globalConfig = Config.Implementation.fromProperties(getConfigProperties());
        if (globalConfig != null) {
            config = new Config.Implementation(config, globalConfig);
        }

        Config classConfig = clazz.getAnnotation(Config.class);
        if (classConfig != null) {
            config = new Config.Implementation(config, classConfig);
        }

        return config;
    }
485175
private static List<Method> getAnnotatedMethods(Class<?> clazz){
		List<Method> methods = new ArrayList<Method>();
		
		for(Method method:getAllMethods(clazz))
			if(!isNull(method.getAnnotation(JMapConversion.class)))
				methods.add(method);
		
		return methods;
	}
645703
public <T> Clazz<T> Clazz( Class<T> clazz )
	{
		_ensureMap();

		@SuppressWarnings( "unchecked" )
		Clazz<T> res = (Clazz<T>) clazzz.get( clazz );
		if( res == null )
			throw new IllegalArgumentException( "Class not supported by ClassInfo : " + clazz.getName() );

		return res;
	}
905465
public static Method getMethod(Class clazz, String methodName, Class<?>... parameterTypes) {
        if (clazz == null) {
            return null;
        }
        try {
            return clazz.getDeclaredMethod(methodName, parameterTypes);
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        }
        return null;
    }
1154702
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
        Assert.notNull(clazz, "类型不能为空");
        Assert.notNull(methodName, "方法名不能为空");

        return METHOD_CACHE.compute(new MethodKey(methodName, clazz, parameterTypes), (k, v) -> {
            if (v == null) {
                try {
                    return allowAccess(clazz.getDeclaredMethod(methodName, parameterTypes));
                } catch (NoSuchMethodException e) {
                    log.error(
                        StringUtils.format("类[{0}]中不存在方法名为[{1}]、方法列表为[{2}]的方法", clazz, methodName,
                            parameterTypes == null ? "null" : Arrays.toString(parameterTypes)));
                    throw new ReflectException(
                        StringUtils.format("类[{0}]中不存在方法名为[{1}]、方法列表为[{2}]的方法", clazz, methodName,
                            parameterTypes == null ? "null" : Arrays.toString(parameterTypes)),
                        e);
                }
            } else {
                return v;
            }
        });
    }
367793
public String findAll(final Class<?> clazz) {
    return new SQL() {
      {
        SELECT("*");
        FROM(EntityUtil.getTableName(clazz));
      }
    }.toString();
  }
1043849
private Collection tryBuildCollection(Class<? extends Collection> clazz) {
        if (List.class.equals(clazz) || Collection.class.equals(clazz)) {
            return new ArrayList();
        } else if (Set.class.equals(clazz)) {
            return new HashSet();
        } else if (List.class.isAssignableFrom(clazz)) {
            try {
                return clazz.newInstance();
            } catch (Exception e) {
                log.warn("指定class[{}]无法创建对象，请为其添加公共无参数构造器，将使用默认实现ArrayList", clazz, e);
                return new ArrayList();
            }
        } else if (Set.class.isAssignableFrom(clazz)) {
            try {
                return clazz.newInstance();
            } catch (Exception e) {
                log.warn("指定class[{}]无法创建对象，请为其添加公共无参数构造器，将使用默认实现HashSet", clazz, e);
                return new HashSet();
            }
        } else {
            log.warn("未知集合类型：[{}]", clazz);
            return null;
        }
    }
1270739
public static File getClassJar(Class clazz) {
		File file = null;

		try {
			file = new File(clazz.getProtectionDomain().getCodeSource().getLocation().toURI());
		} catch (URISyntaxException e) {}

		return file;
	}
459151
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
        if (clazz == null || methodName == null || methodName.length() == 0) {
            return null;
        }

        for (Class<?> itr = clazz; hasSuperClass(itr); ) {
            Method[] methods = itr.getDeclaredMethods();

            for (Method method : methods) {
                if (method.getName().equals(methodName) && Arrays.equals(method.getParameterTypes(), parameterTypes)) {
                    return method;
                }
            }

            itr = itr.getSuperclass();
        }
        return null;
    }