Examples of processEvents()


Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

    ChartTitleFormatRecordGrabber grabber = new ChartTitleFormatRecordGrabber();
    InputStream din = fs.createDocumentInputStream("Workbook");
    HSSFRequest req = new HSSFRequest();
    req.addListenerForAllRecords(grabber);
    HSSFEventFactory factory = new HSSFEventFactory();
    factory.processEvents(req, din);
    din.close();
   
    // Should've found one
    assertEquals(1, grabber.chartTitleFormatRecords.size());
    // And it should be of something interesting
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

            // 添加监听器
            req.addListenerForAllRecords(new Excel2003ImportListener(proxy, dataList, batchSize));
            //  创建事件工厂
            HSSFEventFactory factory = new HSSFEventFactory();
            // 根据文档输入流处理事件
            factory.processEvents(req, dis);


            //把最后剩下的不足batchSize大小
            if (dataList.size() > 0) {
                proxy.doBatchSave(dataList);
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

        // lazy listen for ALL records with the listener shown above
        req.addListenerForAllRecords(new EventExample());
        // create our event factory
        HSSFEventFactory factory = new HSSFEventFactory();
        // process our events based on the document input stream
        factory.processEvents(req, din);
        // once all the events are processed close our file input stream
        fin.close();
        // and our document input stream (don't want to leak these!)
        din.close();
        System.out.println("done.");
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

                //lazy listen for ALL records with the listener shown above
                req.addListenerForAllRecords(this);
                //create our event factory
                final HSSFEventFactory factory = new HSSFEventFactory();
                //process our events based on the document input stream
                factory.processEvents(req, din);
                //close our document input stream (don't want to leak these!)
                din.close();
               
                //now the parsed strings are in the StringBuilder, now convert them to a String
                final String contents = sbFoundStrings.toString().trim();
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    factory.processEvents(req, documentInputStream);
                } catch (final ReadCompletedException e) {
                    SupportLogger.LOGGER.tracef("Completed reading %s%n", resource);
                }
            }
        }).start();
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    factory.processEvents(req, documentInputStream);
                } catch (final ReadCompletedException e) {
                    SupportLogger.LOGGER.tracef("Completed reading %s%n", resource);
                }
            }
        }).start();
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

            // Create event factory and process Workbook (fire events)
            DocumentInputStream documentInputStream = root.createDocumentInputStream("Workbook");
            HSSFEventFactory eventFactory = new HSSFEventFactory();
            try {
                eventFactory.processEvents(hssfRequest, documentInputStream);
            } catch (org.apache.poi.EncryptedDocumentException e) {
                throw new EncryptedDocumentException(e);
            }
           
            // Output any extra text that came after all the sheets
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

        HSSFRequest     req   = new HSSFRequest();

        req.addListenerForAllRecords(new EFHSSFListener(this));
        HSSFEventFactory factory = new HSSFEventFactory();

        factory.processEvents(req, din);
        fin.close();
        din.close();
        FileOutputStream fout = new FileOutputStream(outfile);

        workbook.write(fout);
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

                System.out.println(rec.toString());
            }
        });
        HSSFEventFactory factory = new HSSFEventFactory();

        factory.processEvents(req, din);
    }

    public void setFile(String file)
    {
        this.file = file;
View Full Code Here

Examples of org.apache.poi.hssf.eventusermodel.HSSFEventFactory.processEvents()

            // Create event factory and process Workbook (fire events)
            DocumentInputStream documentInputStream = root.createDocumentInputStream("Workbook");
            HSSFEventFactory eventFactory = new HSSFEventFactory();
            try {
                eventFactory.processEvents(hssfRequest, documentInputStream);
            } catch (org.apache.poi.EncryptedDocumentException e) {
                throw new EncryptedDocumentException(e);
            }
           
            // Output any extra text that came after all the sheets
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.