return findMethod(clazz, methodName, parameterTypes);
Assert.state(initMethodName != null, "No init method set"); final Method initMethod = (mbd.isNonPublicAccessAllowed() ? BeanUtils.findMethod(bean.getClass(), initMethodName) : ClassUtils.getMethodIfAvailable(bean.getClass(), initMethodName));
Assert.state(initMethodName != null, "No init method set"); final Method initMethod = (mbd.isNonPublicAccessAllowed() ? BeanUtils.findMethod(bean.getClass(), initMethodName) : ClassUtils.getMethodIfAvailable(bean.getClass(), initMethodName));
return findMethod(clazz, methodName, parameterTypes);
String initMethodName = mbd.getInitMethodName(); final Method initMethod = (mbd.isNonPublicAccessAllowed() ? BeanUtils.findMethod(bean.getClass(), initMethodName) : ClassUtils.getMethodIfAvailable(bean.getClass(), initMethodName)); if (initMethod == null) {
return findMethod(clazz, methodName, parameterTypes);
private Method detectCustomSpringMethod(Class<?> beanClass, String methodName) { Method m = BeanUtils.findMethod(beanClass, methodName, null); if (m == null) { m = BeanUtils.findMethod(beanClass, methodName, new Class[] { boolean.class }); } return m; }
private Method detectCustomOsgiMethod(Class<?> beanClass, String methodName) { return BeanUtils.findMethod(beanClass, methodName, new Class[] { int.class }); }
/** * Find a method with the given method name and the given parameter types, * declared on the given class or one of its superclasses. Prefers public methods, * but will return a protected, package access, or private method too. * <p>Checks {@code Class.getMethod} first, falling back to * {@code findDeclaredMethod}. This allows to find public methods * without issues even in environments with restricted Java security settings. * @param clazz the class to check * @param methodName the name of the method to find * @param paramTypes the parameter types of the method to find * @return the Method object, or {@code null} if not found * @see Class#getMethod * @see #findDeclaredMethod */ public static Method findMethod(Class<?> clazz, String methodName, Class<?>... paramTypes) { return org.springframework.beans.BeanUtils.findMethod(clazz, methodName, paramTypes); }
"' on bean with name '" + beanName + "'"); Method initMethod = BeanUtils.findMethod(bean.getClass(), initMethodName, null); if (initMethod == null) { throw new NoSuchMethodException("Couldn't find an init method named '" + initMethodName +
return findMethod(clazz, methodName, parameterTypes);
/** * Makes ZK believe the current thread is an event thread. * * @param value If true, the current thread becomes an event thread. If false, it is not an * event thread. * @throws Exception Unspecified exception. */ public void inEventListener(boolean value) throws Exception { Method inEventListener = BeanUtils.findMethod(EventProcessor.class, "inEventListener", boolean.class); inEventListener.setAccessible(true); inEventListener.invoke(null, value); }
value = (V) (val); } else { Method method = BeanUtils.findMethod(clazz, "valueOf", String.class);
/** * Retrieves a property value of the specified data type. It examines the property value for a * type-compatible value. Failing that, it returns the specified default value. * * @param <V> Property value data type. * @param propName Name of property from which to retrieve the value. * @param clazz Expected data type of the property value. * @param dflt Default value to use if a suitable one cannot be found. * @return The value. */ @SuppressWarnings("unchecked") protected <V> V getPropertyValue(String propName, Class<V> clazz, V dflt) { V value = null; if (propName != null) { propName = propName.replace("%", propertyPrefix == null ? "" : propertyPrefix); String val = StringUtils.trimToNull(PropertyUtil.getValue(propName)); if (log.isDebugEnabled()) { log.debug("Property " + propName + " value: " + val); } if (clazz == String.class) { value = (V) (val); } else { Method method = BeanUtils.findMethod(clazz, "valueOf", String.class); if (method != null && method.getReturnType() == clazz) { value = (V) parseString(method, val, null); } } } return value == null ? dflt : value; }
BeanUtils.findMethod(bean.getClass(), initMethodName) : ClassUtils.getMethodIfAvailable(bean.getClass(), initMethodName)); if (initMethod == null) {