List of usage examples for java.lang.reflect Method isBridge
public boolean isBridge()
From source file:org.unitils.core.reflect.ClassWrapper.java
protected void addMethods(Class<?> clazz, List<Method> methods) { if (Object.class.equals(clazz)) { return;// w w w.ja v a 2 s. c o m } Method[] classMethods = clazz.getDeclaredMethods(); for (Method method : classMethods) { // exclude special methods if (!method.isSynthetic() && !method.isBridge() && !isStatic(method.getModifiers())) { methods.add(method); } } addMethods(clazz.getSuperclass(), methods); }
From source file:org.vulpe.commons.util.VulpeReflectUtil.java
/** * Returns list of methods in class or superclass. * * @param clazz/* ww w. j a va2s . co m*/ * @return */ public static List<Method> getMethods(final Class<?> clazz) { if (VulpeCacheHelper.getInstance().contains(clazz.getName().concat(".methods"))) { return VulpeCacheHelper.getInstance().get(clazz.getName().concat(".methods")); } Class<?> baseClass = clazz; final List<Method> list = new ArrayList<Method>(); while (!baseClass.equals(Object.class)) { for (Method method : baseClass.getDeclaredMethods()) { if (!method.isSynthetic() && !method.isBridge() && !Modifier.isStatic(method.getModifiers())) { list.add(method); } } baseClass = baseClass.getSuperclass(); } VulpeCacheHelper.getInstance().put(clazz.getName().concat(".methods"), list); return list; }