From 63d4dc462f714c1df439a974aace46014b8ade22 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sun, 2 Feb 2014 16:41:27 +0000 Subject: [PATCH] Add setIncludeHeadersFooters(boolean) to the ExcelExtractor common interface, as all implementations now have the method git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1563658 13f79535-47bb-0310-9956-ffa450edef68 --- .../hssf/extractor/EventBasedExcelExtractor.java | 15 ++++++++++++--- .../apache/poi/ss/extractor/ExcelExtractor.java | 6 ++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java index 541c048ae0..0eec3d629c 100644 --- a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java +++ b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java @@ -45,7 +45,7 @@ import org.apache.poi.poifs.filesystem.POIFSFileSystem; /** * A text extractor for Excel files, that is based - * on the hssf eventusermodel api. + * on the HSSF EventUserModel API. * It will typically use less memory than * {@link ExcelExtractor}, but may not provide * the same richness of formatting. @@ -108,6 +108,7 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or public SummaryInformation getSummaryInformation() { throw new IllegalStateException("Metadata extraction not supported in streaming mode, please use ExcelExtractor"); } + /** * Would control the inclusion of cell comments from the document, @@ -117,8 +118,16 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or throw new IllegalStateException("Comment extraction not supported in streaming mode, please use ExcelExtractor"); } - - /** + /** + * Would control the inclusion of headers and footers from the document, + * if we supported it + */ + public void setIncludeHeadersFooters(boolean includeHeadersFooters) { + throw new IllegalStateException("Header/Footer extraction not supported in streaming mode, please use ExcelExtractor"); + } + + + /** * Should sheet names be included? Default is true */ public void setIncludeSheetNames(boolean includeSheetNames) { diff --git a/src/java/org/apache/poi/ss/extractor/ExcelExtractor.java b/src/java/org/apache/poi/ss/extractor/ExcelExtractor.java index 8817bc7e29..7fd4849951 100644 --- a/src/java/org/apache/poi/ss/extractor/ExcelExtractor.java +++ b/src/java/org/apache/poi/ss/extractor/ExcelExtractor.java @@ -32,6 +32,12 @@ public interface ExcelExtractor { */ public void setFormulasNotResults(boolean formulasNotResults); + /** + * Should headers and footers be included in the output? + * Default is true + */ + public void setIncludeHeadersFooters(boolean includeHeadersFooters); + /** * Should cell comments be included? Default is false */ -- 2.39.5