Example usage for java.lang.reflect Method isBridge

List of usage examples for java.lang.reflect Method isBridge

Introduction

In this page you can find the example usage for java.lang.reflect Method isBridge.

Prototype

public boolean isBridge() 

Source Link

Document

Returns true if this method is a bridge method; returns false otherwise.

Usage

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;
}