Esempio n. 1
0
 /**
  * 对参数进行转换和检查
  *
  * @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;
   }
 }
Esempio n. 2
0
 /** Java Object->Xml with encoding. */
 public static String toXml(Object root, String encoding) {
   Class clazz = Reflections.getUserClass(root);
   return toXml(root, clazz, encoding);
 }
Esempio n. 3
0
 /** Java Object->Xml without encoding. */
 public static String toXml(Object root) {
   Class clazz = Reflections.getUserClass(root);
   return toXml(root, clazz, null);
 }