org.apache.poi.xssf.usermodel.XSSFTable.mapsTo()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中org.apache.poi.xssf.usermodel.XSSFTable.mapsTo()方法的一些代码示例,展示了XSSFTable.mapsTo()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSSFTable.mapsTo()方法的具体详情如下:
包路径:org.apache.poi.xssf.usermodel.XSSFTable
类名称:XSSFTable
方法名:mapsTo

XSSFTable.mapsTo介绍

[英]Checks if this Table element contains even a single mapping to the map identified by id
[中]检查此表元素是否包含到由id标识的映射的单个映射

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
   * @return the list of all Tables that provide a map rule to this mapping
   */
  public List<XSSFTable> getRelatedTables() {
    List<XSSFTable> tables = new ArrayList<>();
    for (Sheet sheet : mapInfo.getWorkbook()) {
      for (RelationPart rp : ((XSSFSheet)sheet).getRelationParts()) {
        if (rp.getRelationship().getRelationshipType().equals(XSSFRelation.TABLE.getRelation())) {
          XSSFTable table = rp.getDocumentPart();
          if (table.mapsTo(ctMap.getID())) {
            tables.add(table);
          }
        }
      }
    }

    return tables;
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
   * @return the list of all Tables that provide a map rule to this mapping
   */
  public List<XSSFTable> getRelatedTables() {
    List<XSSFTable> tables = new ArrayList<>();
    for (Sheet sheet : mapInfo.getWorkbook()) {
      for (RelationPart rp : ((XSSFSheet)sheet).getRelationParts()) {
        if (rp.getRelationship().getRelationshipType().equals(XSSFRelation.TABLE.getRelation())) {
          XSSFTable table = rp.getDocumentPart();
          if (table.mapsTo(ctMap.getID())) {
            tables.add(table);
          }
        }
      }
    }

    return tables;
  }
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
   * @return the list of all Tables that provide a map rule to this mapping
   */
  public List<XSSFTable> getRelatedTables() {

    List<XSSFTable> tables = new Vector<XSSFTable>();
    int sheetNumber = mapInfo.getWorkbook().getNumberOfSheets();

    for (int i = 0; i < sheetNumber; i++) {
      XSSFSheet sheet = mapInfo.getWorkbook().getSheetAt(i);
      for (POIXMLDocumentPart p : sheet.getRelations()) {
        if (p.getPackageRelationship().getRelationshipType().equals(XSSFRelation.TABLE.getRelation())) {
          XSSFTable table = (XSSFTable) p;
          if (table.mapsTo(ctMap.getID())) {
            tables.add(table);
          }
        }
      }
    }

    return tables;
  }
}

相关文章