/** * 对参数进行转换和检查 * * @param parameterObject 参数对象 * @param page 分页对象 * @return 分页对象 * @throws NoSuchFieldException 无法找到参数 */ @SuppressWarnings("unchecked") protected static PageBean<Object> convertParameter( Object parameterObject, PageBean<Object> page) { try { if (parameterObject instanceof PageBean) { return (PageBean<Object>) parameterObject; } else { return (PageBean<Object>) Reflections.getFieldValue(parameterObject, PAGE); } } catch (Exception e) { return null; } }
/** Java Object->Xml with encoding. */ public static String toXml(Object root, String encoding) { Class clazz = Reflections.getUserClass(root); return toXml(root, clazz, encoding); }
/** Java Object->Xml without encoding. */ public static String toXml(Object root) { Class clazz = Reflections.getUserClass(root); return toXml(root, clazz, null); }