• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SheetContentsHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler的典型用法代码示例。如果您正苦于以下问题:Java SheetContentsHandler类的具体用法?Java SheetContentsHandler怎么用?Java SheetContentsHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SheetContentsHandler类属于org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler包,在下文中一共展示了SheetContentsHandler类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: processSheet

import org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler; //导入依赖的package包/类
public void processSheet(SheetContentsHandler sheetContentsExtractor,
    StylesTable styles, ReadOnlySharedStringsTable strings,
    InputStream sheetInputStream) throws IOException, SAXException {
  InputSource sheetSource = new InputSource(sheetInputStream);
  SAXParserFactory saxFactory = SAXParserFactory.newInstance();
  try {
    SAXParser saxParser = saxFactory.newSAXParser();
    XMLReader sheetParser = saxParser.getXMLReader();
    XSSFSheetInterestingPartsCapturer handler = new XSSFSheetInterestingPartsCapturer(
        new XSSFSheetXMLHandler(styles, strings, sheetContentsExtractor,
            formatter, false));
    sheetParser.setContentHandler(handler);
    sheetParser.parse(sheetSource);
    sheetInputStream.close();

    if (handler.hasProtection) {
      metadata.set(TikaMetadataKeys.PROTECTED, "true");
    }
  } catch (ParserConfigurationException e) {
    throw new RuntimeException("SAX parser appears to be broken - "
        + e.getMessage());
  }
}
 
开发者ID:kolbasa,项目名称:OCRaptor,代码行数:24,代码来源:XSSFExcelExtractorDecorator.java


示例2: processSheet

import org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler; //导入依赖的package包/类
/**
 * Parses and shows the content of one sheet using the specified styles and
 * shared-strings tables.
 *
 * @param styles
 * @param strings
 * @param sheetInputStream
 */
public void processSheet(StylesTable styles, ReadOnlySharedStringsTable strings, SheetContentsHandler sheetHandler,
                         InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
    DataFormatter formatter = new DataFormatter();
    InputSource sheetSource = new InputSource(sheetInputStream);
    try {
        XMLReader sheetParser = SAXHelper.newXMLReader();
        ContentHandler handler = new XSSFSheetXMLHandler(styles, null, strings, sheetHandler, formatter, false);
        sheetParser.setContentHandler(handler);
        sheetParser.parse(sheetSource);
    } catch (ParserConfigurationException e) {
        throw new RuntimeException("SAX parser appears to be broken - " + e.getMessage());
    }
}
 
开发者ID:warlock-china,项目名称:azeroth,代码行数:22,代码来源:XLSX2CSV.java


示例3: processSheet

import org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler; //导入依赖的package包/类
/**
 * Parses and shows the content of one sheet using the specified styles and
 * shared-strings tables.
 *
 * @param styles
 * @param strings
 * @param sheetInputStream
 */
public void processSheet(StylesTable styles, ReadOnlySharedStringsTable strings, SheetContentsHandler sheetHandler,
		InputStream sheetInputStream) throws IOException, ParserConfigurationException, SAXException {
	DataFormatter formatter = new DataFormatter();
	InputSource sheetSource = new InputSource(sheetInputStream);
	try {
		XMLReader sheetParser = SAXHelper.newXMLReader();
		ContentHandler handler = new XSSFSheetXMLHandler(styles, null, strings, sheetHandler, formatter, false);
		sheetParser.setContentHandler(handler);
		sheetParser.parse(sheetSource);
	} catch (ParserConfigurationException e) {
		throw new RuntimeException("SAX parser appears to be broken - " + e.getMessage());
	}
}
 
开发者ID:vakinge,项目名称:jeesuite-libs,代码行数:22,代码来源:XLSX2CSV.java


示例4: parseSheet

import org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler; //导入依赖的package包/类
private void parseSheet(StylesTable styles, ReadOnlySharedStringsTable sst, InputSource sheetSource, SheetContentsHandler handler) {
	try {
		createSheetParser( new XSSFSheetXMLHandler(styles, sst, handler, false)).parse(sheetSource);			
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:PGWelch,项目名称:com.opendoorlogistics,代码行数:8,代码来源:XmlParserLoader.java


示例5: ExcelReader

import org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler; //导入依赖的package包/类
/**
 * Constructor: Microsoft Excel File (XSLX) Reader
 * 
 * @param pkg a {@link OPCPackage} object - The package to process XLSX
 * @param sheetContentsHandler a {@link SheetContentsHandler} object - WorkSheet contents handler
 * @param sheetCallback a {@link ExcelSheetCallback} object - WorkSheet callback for sheet
 *        processing begin and end (can be null)
 */
public ExcelReader(OPCPackage pkg, SheetContentsHandler sheetContentsHandler,
    ExcelSheetCallback sheetCallback) {
  this.xlsxPackage = pkg;
  this.sheetContentsHandler = sheetContentsHandler;
  this.sheetCallback = sheetCallback;
}
 
开发者ID:jeevatkm,项目名称:excelReader,代码行数:15,代码来源:ExcelReader.java



注:本文中的org.apache.poi.xssf.eventusermodel.XSSFSheetXMLHandler.SheetContentsHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ByteRange类代码示例发布时间:2022-05-22
下一篇:
Java TableDataFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap