]> source.dussan.org Git - poi.git/commitdiff
Move location where document is held and adjust constructors and class-hierarchy...
authorDominik Stadler <centic@apache.org>
Sun, 17 May 2015 21:26:31 +0000 (21:26 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 17 May 2015 21:26:31 +0000 (21:26 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1679903 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/POIOLE2TextExtractor.java
src/java/org/apache/poi/POITextExtractor.java
src/java/org/apache/poi/hpsf/extractor/HPSFPropertiesExtractor.java
src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
src/ooxml/java/org/apache/poi/POIXMLTextExtractor.java

index 7679136c89701db0832d615a44d3508c08ccad8a..5dd1d755e358ceecc0b14dfcbdd26c694194dcdc 100644 (file)
@@ -33,15 +33,27 @@ import org.apache.poi.poifs.filesystem.DirectoryEntry;
  * @see org.apache.poi.hwpf.extractor.WordExtractor
  */
 public abstract class POIOLE2TextExtractor extends POITextExtractor {
+       /** The POIDocument that's open */
+       protected POIDocument document;
+
        /**
         * Creates a new text extractor for the given document
         * 
         * @param document The POIDocument to use in this extractor.
         */
        public POIOLE2TextExtractor(POIDocument document) {
-               super(document);
+               this.document = document;
        }
 
+       /**
+        * Creates a new text extractor, using the same
+        *  document as another text extractor. Normally
+        *  only used by properties extractors.
+        */
+       protected POIOLE2TextExtractor(POIOLE2TextExtractor otherExtractor) {
+               this.document = otherExtractor.document;
+       }
+       
        /**
         * Returns the document information metadata for the document
         * 
index e18078b461f4cec23dad0d137a13d661983d546c..6514ad5d1889b9fbb7812e97586b75777a94a07b 100644 (file)
@@ -31,24 +31,6 @@ import java.io.IOException;
  * @see org.apache.poi.hwpf.extractor.WordExtractor
  */
 public abstract class POITextExtractor implements Closeable {
-       /** The POIDocument that's open */
-       protected POIDocument document;
-
-       /**
-        * Creates a new text extractor for the given document
-        */
-       public POITextExtractor(POIDocument document) {
-               this.document = document;
-       }
-       /**
-        * Creates a new text extractor, using the same
-        *  document as another text extractor. Normally
-        *  only used by properties extractors.
-        */
-       protected POITextExtractor(POITextExtractor otherExtractor) {
-               this.document = otherExtractor.document;
-       }
-       
        /**
         * Retrieves all the text from the document.
         * How cells, paragraphs etc are separated in the text
index 1a0db038972d9bb280dbcef7558f6c43b62fb9f2..b7967f333c80f9efb8ef4a4f7560626305d42aea 100644 (file)
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.util.Iterator;
 
 import org.apache.poi.POIDocument;
+import org.apache.poi.POIOLE2TextExtractor;
 import org.apache.poi.POITextExtractor;
 import org.apache.poi.hpsf.CustomProperties;
 import org.apache.poi.hpsf.DocumentSummaryInformation;
@@ -39,10 +40,10 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem;
  *  build in and custom, returning them in
  *  textual form.
  */
-public class HPSFPropertiesExtractor extends POITextExtractor {
+public class HPSFPropertiesExtractor extends POIOLE2TextExtractor {
     private Closeable toClose;
 
-    public HPSFPropertiesExtractor(POITextExtractor mainExtractor) {
+    public HPSFPropertiesExtractor(POIOLE2TextExtractor mainExtractor) {
         super(mainExtractor);
     }
     public HPSFPropertiesExtractor(POIDocument doc) {
index 889de20b4c5cb089d0202cbb905fba65ad50d0d6..debeee92c4f91b580e8b37f521ace333cb655d70 100644 (file)
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.poi.POIDocument;
 import org.apache.poi.POIOLE2TextExtractor;
 import org.apache.poi.hpsf.DocumentSummaryInformation;
 import org.apache.poi.hpsf.SummaryInformation;
@@ -75,7 +76,7 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or
 
     public EventBasedExcelExtractor( DirectoryNode dir )
     {
-        super( null );
+        super( (POIDocument)null );
         _dir = dir;
     }
 
index 3a600f48a963f4e67780944b5b67eafd41de78b8..705bf42a6b84357ee587224308abc996bbaab413 100644 (file)
@@ -32,8 +32,6 @@ public abstract class POIXMLTextExtractor extends POITextExtractor {
         * Creates a new text extractor for the given document
         */
        public POIXMLTextExtractor(POIXMLDocument document) {
-               super((POIDocument)null);
-
                _document = document;
        }