Package org.jeecgframework.core.util

Examples of org.jeecgframework.core.util.ReflectHelper


   * 构建树形数据表
   */
  public List<TreeGrid> treegrid(List all, TreeGridModel treeGridModel) {
    List<TreeGrid> treegrid = new ArrayList<TreeGrid>();
    for (Object obj : all) {
      ReflectHelper reflectHelper = new ReflectHelper(obj);
      TreeGrid tg = new TreeGrid();
      String id = oConvertUtils.getString(reflectHelper.getMethodValue(treeGridModel.getIdField()));
      String src = oConvertUtils.getString(reflectHelper.getMethodValue(treeGridModel.getSrc()));
      String text = oConvertUtils.getString(reflectHelper.getMethodValue(treeGridModel.getTextField()));
      if(StringUtils.isNotEmpty(treeGridModel.getOrder())){
        String order = oConvertUtils.getString(reflectHelper.getMethodValue(treeGridModel.getOrder()));
        tg.setOrder(order);
      }
      tg.setId(id);
      if (treeGridModel.getIcon() != null) {
        String iconpath = TagUtil.fieldNametoValues(treeGridModel.getIcon(), obj).toString();
        if (iconpath != null) {
          tg.setCode(iconpath);
        } else {
          tg.setCode("");
        }
      }
      tg.setSrc(src);
      tg.setText(text);
      if (treeGridModel.getParentId() != null) {
        Object pid = TagUtil.fieldNametoValues(treeGridModel.getParentId(), obj);
        if (pid != null) {
          tg.setParentId(pid.toString());
        } else {
          tg.setParentId("");
        }
      }
      if (treeGridModel.getParentText() != null) {
        Object ptext = TagUtil.fieldNametoValues(treeGridModel.getTextField(), obj);
        if (ptext != null) {
          tg.setParentText(ptext.toString());
        } else {
          tg.setParentText("");
        }

      }
      List childList = (List) reflectHelper.getMethodValue(treeGridModel.getChildList());

      if (childList != null && childList.size() > 0) {
        tg.setState("closed");
      }
      if (treeGridModel.getRoleid() != null) {
View Full Code Here

TOP

Related Classes of org.jeecgframework.core.util.ReflectHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.