public Method findMethod(String name, Object[] in) { Object o = this.cache.get(name); if (o == null) return null; if (o instanceof Method) return (Method) o; Method r = null; Class[] types = paramTypes(in); for (Method m : (List<Method>) o) { if (m.getParameterTypes().length == types.length) { if (r == null) { r = m; } else { r = pickBest(types, r, m); } } } return r; } }
public Method findMethod(String name, Object[] in) { Object o = this.cache.get(name); if (o == null) return null; if (o instanceof Method) return (Method) o; Method r = null; Class[] types = paramTypes(in); for (Method m : (List<Method>) o) { if (m.getParameterTypes().length == types.length) { if (r == null) { r = m; } else { r = pickBest(types, r, m); } } } return r; } }
public Method findMethod(String name, Object[] in) { Object o = this.cache.get(name); if (o == null) return null; if (o instanceof Method) return (Method) o; Method r = null; Class[] types = paramTypes(in); for (Method m : (List<Method>) o) { if (m.getParameterTypes().length == types.length) { if (r == null) { r = m; } else { r = pickBest(types, r, m); } } } return r; } }
public static Method findMethod(Object base, Object name, Object[] params) { Method r = null; if (base != null && name != null) { Class type = base.getClass(); String methodName = ELSupport.coerceToString(name); MethodCache m = methodCache.get(type); // if (m == null || type != m.getType()) { // m = new MethodCache(type); // methodCache.set(type, m); // } r = m.findMethod(methodName, params); if (r == null) { throw new MethodNotFoundException(MessageFactory.get( "error.method.notfound", base, name, paramString(paramTypes(params)))); } } else { throw new MethodNotFoundException(); } return r; }
public static Method findMethod(Object base, Object name, Object[] params) { Method r = null; if (base != null && name != null) { Class type = base.getClass(); String methodName = ELSupport.coerceToString(name); MethodCache m = methodCache.get(type); // if (m == null || type != m.getType()) { // m = new MethodCache(type); // methodCache.set(type, m); // } r = m.findMethod(methodName, params); if (r == null) { throw new MethodNotFoundException(MessageFactory.get( "error.method.notfound", base, name, paramString(paramTypes(params)))); } } else { throw new MethodNotFoundException(); } return r; }
public static Method findMethod(Object base, Object name, Object[] params) { Method r = null; if (base != null && name != null) { Class type = base.getClass(); String methodName = ELSupport.coerceToString(name); MethodCache m = methodCache.get(type); // if (m == null || type != m.getType()) { // m = new MethodCache(type); // methodCache.set(type, m); // } r = m.findMethod(methodName, params); if (r == null) { throw new MethodNotFoundException(MessageFactory.get( "error.method.notfound", base, name, paramString(paramTypes(params)))); } } else { throw new MethodNotFoundException(); } return r; }