/** * @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; } }
/** * @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; } }
/** * @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; } }