diff options
author | Dominik Stadler <centic@apache.org> | 2017-09-25 14:45:14 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2017-09-25 14:45:14 +0000 |
commit | ee993f163d5954de54bde942c70e4fd361f09968 (patch) | |
tree | 3021307bdc1bb3b803a12e00a281888783f7ac1f /src | |
parent | bf6cd20f10d6a6962ab5da483fea9c30aa80ea5b (diff) | |
download | poi-ee993f163d5954de54bde942c70e4fd361f09968.tar.gz poi-ee993f163d5954de54bde942c70e4fd361f09968.zip |
Replace the incompatible new interface method endSheet() with a Java 8 default method so existing implementations do not need to be adjusted. Also use this for headerFooter() and remove the empty implementations that are now obsolete.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809635 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
4 files changed, 2 insertions, 25 deletions
diff --git a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java index 39b978a77d..1f7a064f67 100644 --- a/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java +++ b/src/examples/src/org/apache/poi/xssf/eventusermodel/XLSX2CSV.java @@ -135,15 +135,6 @@ public class XLSX2CSV { output.append('"'); } } - - @Override - public void headerFooter(String text, boolean isHeader, String tagName) { - // Skip, no headers or footers in CSV - } - - @Override - public void endSheet() { - } } diff --git a/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java b/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java index 6de5f5f6cb..919d007cb1 100644 --- a/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java +++ b/src/examples/src/org/apache/poi/xssf/streaming/examples/HybridStreaming.java @@ -65,22 +65,12 @@ public class HybridStreaming { } @Override - public void headerFooter(String text, boolean isHeader, String tagName) { - } - - @Override public void endRow(int rowNum) { } @Override public void cell(String cellReference, String formattedValue, XSSFComment comment) { } - - @Override - public void endSheet() { - - } }; } - } diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java index 1b343e4c07..e5f5e5c503 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/XSSFSheetXMLHandler.java @@ -515,9 +515,9 @@ public class XSSFSheetXMLHandler extends DefaultHandler { public void cell(String cellReference, String formattedValue, XSSFComment comment); /** A header or footer has been encountered */ - public void headerFooter(String text, boolean isHeader, String tagName); + public default void headerFooter(String text, boolean isHeader, String tagName) {} /** Signal that the end of a sheet was been reached */ - public void endSheet(); + public default void endSheet() {} } } diff --git a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java index efcce6f94b..d94df4cf28 100644 --- a/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java +++ b/src/ooxml/java/org/apache/poi/xssf/extractor/XSSFEventBasedExcelExtractor.java @@ -343,10 +343,6 @@ public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor } @Override - public void endSheet() { - } - - @Override public void cell(String cellRef, String formattedValue, XSSFComment comment) { if(firstCellOfRow) { firstCellOfRow = false; |