public static Method getMethod ( String name , Object target , Map < String , Method > cache ) { Class < ? > tclass = target . getClass ( ) ; String key = tclass . getName ( ) + ":" + name ; Method method = cache . get ( key ) ; if ( method == null ) { method = findMethod ( tclass , name ) ; if ( method != null ) { cache . put ( key , method ) ; } } return method ; }
Locates and returns the first method in the supplied class whose name is equal to the specified name . If a method is located it will be cached in the supplied cache so that subsequent requests will immediately return the method from the cache rather than re - reflecting .