static Object send(Object object,String methodName,Object[] parameters,Class<?> objectClass,Class<?>[] parameterTypes) throws SecurityException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
  try {
    if (parameters == null) {
      parameters=new Object[]{};
    }
    if (parameterTypes == null) {
      parameterTypes=new Class[]{};
    }
    Method method=objectClass.getDeclaredMethod(methodName,parameterTypes);
    method.setAccessible(true);
    return method.invoke(object,parameters);
  }
 catch (  NoSuchMethodException e) {
    throw new DataSupportException(DataSupportException.noSuchMethodException(objectClass.getSimpleName(),methodName));
  }
}

static Object send ( Object object , String methodName , Object [ ] parameters , Class < ? > objectClass , Class < ? > [ ] parameterTypes ) throws SecurityException , IllegalArgumentException , IllegalAccessException , InvocationTargetException { try { if ( parameters == null ) { parameters = new Object [ ] { } ; } if ( parameterTypes == null ) { parameterTypes = new Class [ ] { } ; } Method method = objectClass . getDeclaredMethod ( methodName , parameterTypes ) ; method . setAccessible ( true ) ; return method . invoke ( object , parameters ) ; } catch ( NoSuchMethodException e ) { throw new DataSupportException ( DataSupportException . noSuchMethodException ( objectClass . getSimpleName ( ) , methodName ) ) ; } }
this method use java reflect api to execute method dynamically . most importantly , it could access the methods with private modifier to break encapsulation .
