code: private static String[] getObjValues(Object source, String... fieldnames) throws Exception {
          String[] results = new String[fieldnames.length];
          Field field;
          String value;
          Object obj;
          for (int i = 0; i < fieldnames.length; i++) {
              field = FieldUtil.getField(source, fieldnames[i]);
              if (field == null) {
                  continue;
              }
              obj = field.get(source);
              if (obj == null) {
                  value = "";
              } else if (obj instanceof Date) {
                  value = DateUtil.smartFormat((Date) obj);
              } else {
                  value = String.valueOf(obj);
              }
              results[i] = value;
          }
          return results;
      }
docs: 获取对象指定字段值
  
  @param source     对象
  @param fieldnames 属性名数组
  @return 对象的字符串数组，和属性名对应
  @throws Exception