@SuppressWarnings("unchecked")
  protected static <T> T invoke(Method method, Object object, Object... parameters)
      throws IOException, RuntimeException {
    try {
      return (T) method.invoke(object, parameters);
    } catch (IllegalArgumentException e) {
      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    } catch (InvocationTargetException e) {
      if (e.getTargetException() instanceof IOException) {
        throw (IOException) e.getTargetException();
      } else {
        throw new RuntimeException(e);
      }
    }
  }
Invoke a method on an object and return whatever it returns.

@param method The method to invoke.
@param object The instance or class (for static methods) on which to invoke the method.
@param parameters The parameters to pass to the method.
@return Whatever the method returns.
@throws IOException If I/O errors occur
@throws StripesRuntimeException If anything else goes wrong
src/main/java/org/apache/ibatis/io/VFS.java