E2xCmdline.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:Excel2XML 作者:
/**
 * Exports a single sheet to a file
 *
 * @param sheet
 * @throws FactoryConfigurationError
 * @throws XMLStreamException
 * @throws UnsupportedEncodingException
 * @throws FileNotFoundException
 */
private void export(final XSSFSheet sheet, final XMLStreamWriter out)
        throws UnsupportedEncodingException, XMLStreamException, FactoryConfigurationError, FileNotFoundException {
    boolean isFirst = true;
    final Map<String, String> columns = new HashMap<String, String>();
    final String sheetName = sheet.getSheetName();
    System.out.print(sheetName);
    out.writeStartElement("sheet");
    out.writeAttribute("name", sheetName);
    Iterator<Row> rowIterator = sheet.rowIterator();
    while (rowIterator.hasNext()) {
        Row row = rowIterator.next();
        if (isFirst) {
            isFirst = false;
            this.writeFirstRow(row, out, columns);
        } else {
            this.writeRow(row, out, columns);
        }
    }
    out.writeEndElement();
    System.out.println("..");
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号