Example usage for org.apache.poi.xwpf.usermodel XWPFTableRow getTableICells

List of usage examples for org.apache.poi.xwpf.usermodel XWPFTableRow getTableICells

Introduction

In this page you can find the example usage for org.apache.poi.xwpf.usermodel XWPFTableRow getTableICells.

Prototype

public List<ICell> getTableICells() 

Source Link

Document

create and return a list of all XWPFTableCell who belongs to this row

Usage

From source file:org.apache.tika.parser.microsoft.ooxml.XWPFWordExtractorDecorator.java

License:Apache License

private void extractTable(XWPFTable table, XWPFListManager listManager, XHTMLContentHandler xhtml)
        throws SAXException, XmlException, IOException {
    xhtml.startElement("table");
    xhtml.startElement("tbody");
    for (XWPFTableRow row : table.getRows()) {
        xhtml.startElement("tr");
        for (ICell cell : row.getTableICells()) {
            xhtml.startElement("td");
            if (cell instanceof XWPFTableCell) {
                extractIBodyText((XWPFTableCell) cell, listManager, xhtml);
            } else if (cell instanceof XWPFSDTCell) {
                xhtml.characters(((XWPFSDTCell) cell).getContent().getText());
            }//  ww w.j a v  a2 s .  c o  m
            xhtml.endElement("td");
        }
        xhtml.endElement("tr");
    }
    xhtml.endElement("tbody");
    xhtml.endElement("table");
}