/** * create data mediator for target interface class. * @param clazz the interface class * @param <T> the module type * @return the proxy helper for target module type. */ public static <T> DataMediator<T> createDataMediator(Class<T> clazz){ T t = createData(clazz); try { Class<?> proxyClazz = Class.forName(getProxyClassName(clazz)); return new DataMediator<T>((BaseMediator<T>) proxyClazz.getConstructor(clazz).newInstance(t)); } catch (Exception e) { throw new IllegalArgumentException("can't create module proxy for class("+ clazz.getName() + ")! have you make project or rebuild ? " ,e); } }
/** * create data mediator for target interface class. * @param clazz the interface class * @param <T> the module type * @return the proxy helper for target module type. */ public static <T> DataMediator<T> createDataMediator(Class<T> clazz){ T t = createData(clazz); try { Class<?> proxyClazz = Class.forName(getProxyClassName(clazz)); return new DataMediator<T>((BaseMediator<T>) proxyClazz.getConstructor(clazz).newInstance(t)); } catch (Exception e) { throw new IllegalArgumentException("can't create module proxy for class("+ clazz.getName() + ")! have you make project or rebuild ? " ,e); } }