code: private AccessibleObject findMethodOrField(Object bean, String field, String method) throws SecurityException, NoSuchFieldException, NoSuchMethodException, ClassNotFoundException {
  		AccessibleObject rv;
  		if (field != null) {
  			rv = bean.getClass().getDeclaredField(field);
  		} else {
  			String methodName = method.substring(0, method.indexOf("("));
  			String[] params = method.substring(method.indexOf("(")+1, method.indexOf(")")).split(",");
  			Class[] paramTypes = new Class[params.length];
  			for(int i=0; i<params.length; i++) {
  				String className = params[i];
  				if (className.indexOf('.') < 0) {
  					className = "java.lang." + className;
  				}
  				paramTypes[i] = Class.forName(className);
  			}
  			rv = bean.getClass().getMethod(methodName, paramTypes);
  		}
  		return rv;
  	}
docs: Finds a {@link java.lang.reflect.Method} or {@link java.lang.reflect.Method} in the bean
  instance with the requested name.
  @param bean    bean instance
  @param field   name of the field (field XOR method must be specified)
  @param method  name of the method (field XOR method must be specified)
  @return the reflection reference
  @throws SecurityException
  @throws NoSuchFieldException
  @throws NoSuchMethodException
  @throws ClassNotFoundException