Package cn.guoyukun.pdm2pdf.model

Examples of cn.guoyukun.pdm2pdf.model.ColInfo


   * @param to
   * @param colCodes
   */
  private void moveColumns(Map<String, ColInfo> from, Map<String, ColInfo> to, String[] colCodes){
    for(String colCode : colCodes){
      ColInfo colInfo = from.remove(colCode);
      if(colInfo ==null){
        continue;
      }
      to.put( colCode, colInfo);
    }
View Full Code Here


  private Map<String, ColInfo> parseColumns(Element table)
      throws JDOMException {
    List<Element> allColumns = EXPR_COLUMN.evaluate(table);
    Map<String, ColInfo> colInfos = Maps.newLinkedHashMap();
    for (Element col : allColumns) {
      ColInfo colInfo = parseColumn(col);
      colInfos.put(colInfo.getCode(), colInfo);
    }
    return colInfos;
  }
View Full Code Here

    String name = getColumnAttr(col, "Name");
    String desc = getColumnAttr(col, "Comment");
    String type = getColumnAttr(col, "DataType");
    String nullable = getColumnAttr(col, "Column.Mandatory") ;
   
    ColInfo colInfo = new ColInfo();
    colInfo.setCode(code);
    colInfo.setName(name);
    colInfo.setDesc(desc);
    colInfo.setType(type);
   
    if("ID".equals(colInfo.getCode())){
      colInfo.setDesc("复合主键:业务ID");
    }else if("UPLOAD_ORG_CODE".equals(colInfo.getCode())){
      colInfo.setDesc("复合主键:上传机构代码");
    }
   
    
    if(nullable!=null && "1".equals( nullable)){
      colInfo.setNullable(false)
    }else{
      colInfo.setNullable(true);
    }
   
    return colInfo;
  }
View Full Code Here

  }

  public void addColumns(PdfPTable t, Map<String, ColInfo> cols) {
    if (cols != null) {
      for (Entry<String, ColInfo> entry : cols.entrySet()) {
        ColInfo colInfo = entry.getValue();
        if (colInfo == null) {
          LOG.warn("字段【{}】为空!!", entry.getKey());
          continue;
        }
        boolean nullable = colInfo.isNullable();
       
        addCell(t, colInfo.getName(), nullable);
        addCell(t, colInfo.getCode(), nullable);
        addCell(t, colInfo.getType(), nullable);
        addCell(t, nullable ? "可选" : "必填", nullable);
        addCell(t, colInfo.getDesc(), nullable);
      }
    }
  }
View Full Code Here

TOP

Related Classes of cn.guoyukun.pdm2pdf.model.ColInfo

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.