Author: nick
Date: Sun Feb 2 16:23:26 2014
New Revision: 1563650
URL: http://svn.apache.org/r1563650
Log:
Have the Excel text extractors all implement the same interface, as best as
they can
Modified:
poi/trunk/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java
Modified:
poi/trunk/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java?rev=1563650&r1=1563649&r2=1563650&view=diff
==============================================================================
---
poi/trunk/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
(original)
+++
poi/trunk/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
Sun Feb 2 16:23:26 2014
@@ -59,10 +59,10 @@ import org.apache.poi.poifs.filesystem.P
* <link
href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java">
*
http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/hssf/eventusermodel/examples/XLS2CSVmra.java</link>
*/
-public class EventBasedExcelExtractor extends POIOLE2TextExtractor {
- private DirectoryNode _dir;
- boolean _includeSheetNames = true;
- boolean _formulasNotResults = false;
+public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements
org.apache.poi.ss.extractor.ExcelExtractor {
+ private DirectoryNode _dir;
+ boolean _includeSheetNames = true;
+ boolean _formulasNotResults = false;
/**
* @deprecated Use {@link #EventBasedExcelExtractor(DirectoryNode)} instead
@@ -109,7 +109,15 @@ public class EventBasedExcelExtractor ex
throw new IllegalStateException("Metadata extraction not
supported in streaming mode, please use ExcelExtractor");
}
+ /**
+ * Would control the inclusion of cell comments from the document,
+ * if we supported it
+ */
+ public void setIncludeCellComments(boolean includeComments) {
+ throw new IllegalStateException("Comment extraction not supported in
streaming mode, please use ExcelExtractor");
+ }
+
/**
* Should sheet names be included? Default is true
*/
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java?rev=1563650&r1=1563649&r2=1563650&view=diff
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java
Sun Feb 2 16:23:26 2014
@@ -26,10 +26,10 @@ import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.apache.poi.POIXMLProperties;
-import org.apache.poi.POIXMLTextExtractor;
import org.apache.poi.POIXMLProperties.CoreProperties;
import org.apache.poi.POIXMLProperties.CustomProperties;
import org.apache.poi.POIXMLProperties.ExtendedProperties;
+import org.apache.poi.POIXMLTextExtractor;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.ss.usermodel.DataFormatter;
@@ -50,14 +50,15 @@ import org.xml.sax.XMLReader;
* Implementation of a text extractor from OOXML Excel
* files that uses SAX event based parsing.
*/
-public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor {
- private OPCPackage container;
- private POIXMLProperties properties;
-
- private Locale locale;
- private boolean includeSheetNames = true;
- private boolean formulasNotResults = false;
- private boolean includeTextBoxes = true;
+public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor
+ implements org.apache.poi.ss.extractor.ExcelExtractor {
+ private OPCPackage container;
+ private POIXMLProperties properties;
+
+ private Locale locale;
+ private boolean includeSheetNames = true;
+ private boolean formulasNotResults = false;
+ private boolean includeTextBoxes = true;
public XSSFEventBasedExcelExtractor(String path) throws XmlException,
OpenXML4JException, IOException {
this(OPCPackage.open(path));
@@ -97,12 +98,19 @@ public class XSSFEventBasedExcelExtracto
/**
* Should text from textboxes be included? Default is true
*/
-
public void setIncludeTextBoxes(boolean includeTextBoxes) {
this.includeTextBoxes = includeTextBoxes;
}
- public void setLocale(Locale locale) {
+ /**
+ * Would control the inclusion of cell comments from the document,
+ * if we supported it
+ */
+ public void setIncludeCellComments(boolean includeCellComments) {
+ throw new IllegalStateException("Comment extraction not supported
in streaming mode, please use XSSFExcelExtractor");
+ }
+
+ public void setLocale(Locale locale) {
this.locale = locale;
}
Modified:
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java
URL:
http://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java?rev=1563650&r1=1563649&r2=1563650&view=diff
==============================================================================
---
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java
(original)
+++
poi/trunk/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFExcelExtractor.java
Sun Feb 2 16:23:26 2014
@@ -42,7 +42,8 @@ import org.apache.xmlbeans.XmlException;
/**
* Helper class to extract text from an OOXML Excel file
*/
-public class XSSFExcelExtractor extends POIXMLTextExtractor implements
org.apache.poi.ss.extractor.ExcelExtractor {
+public class XSSFExcelExtractor extends POIXMLTextExtractor
+ implements org.apache.poi.ss.extractor.ExcelExtractor {
public static final XSSFRelation[] SUPPORTED_TYPES = new XSSFRelation[] {
XSSFRelation.WORKBOOK, XSSFRelation.MACRO_TEMPLATE_WORKBOOK,
XSSFRelation.MACRO_ADDIN_WORKBOOK, XSSFRelation.TEMPLATE_WORKBOOK,
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]