Search in sources :

Example 1 with SingleXmlCells

use of org.apache.poi.xssf.model.SingleXmlCells in project poi by apache.

the class XSSFMap method getRelatedSingleXMLCell.

/**
     * @return the list of Single Xml Cells that provide a map rule to this mapping.
     */
public List<XSSFSingleXmlCell> getRelatedSingleXMLCell() {
    List<XSSFSingleXmlCell> relatedSimpleXmlCells = new ArrayList<XSSFSingleXmlCell>();
    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 instanceof SingleXmlCells) {
                SingleXmlCells singleXMLCells = (SingleXmlCells) p;
                for (XSSFSingleXmlCell cell : singleXMLCells.getAllSimpleXmlCell()) {
                    if (cell.getMapId() == ctMap.getID()) {
                        relatedSimpleXmlCells.add(cell);
                    }
                }
            }
        }
    }
    return relatedSimpleXmlCells;
}
Also used : SingleXmlCells(org.apache.poi.xssf.model.SingleXmlCells) POIXMLDocumentPart(org.apache.poi.POIXMLDocumentPart) ArrayList(java.util.ArrayList) XSSFSingleXmlCell(org.apache.poi.xssf.usermodel.helpers.XSSFSingleXmlCell)

Aggregations

ArrayList (java.util.ArrayList)1 POIXMLDocumentPart (org.apache.poi.POIXMLDocumentPart)1 SingleXmlCells (org.apache.poi.xssf.model.SingleXmlCells)1 XSSFSingleXmlCell (org.apache.poi.xssf.usermodel.helpers.XSSFSingleXmlCell)1