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
This commit is contained in:
Dominik Stadler 2017-09-25 14:45:14 +00:00
parent 7a2ce09761
commit 61a281e790
4 changed files with 2 additions and 25 deletions

View File

@ -135,15 +135,6 @@ public class XLSX2CSV {
output.append('"'); output.append('"');
} }
} }
@Override
public void headerFooter(String text, boolean isHeader, String tagName) {
// Skip, no headers or footers in CSV
}
@Override
public void endSheet() {
}
} }

View File

@ -64,10 +64,6 @@ public class HybridStreaming {
public void startRow(int rowNum) { public void startRow(int rowNum) {
} }
@Override
public void headerFooter(String text, boolean isHeader, String tagName) {
}
@Override @Override
public void endRow(int rowNum) { public void endRow(int rowNum) {
} }
@ -75,12 +71,6 @@ public class HybridStreaming {
@Override @Override
public void cell(String cellReference, String formattedValue, XSSFComment comment) { public void cell(String cellReference, String formattedValue, XSSFComment comment) {
} }
@Override
public void endSheet() {
}
}; };
} }
} }

View File

@ -515,9 +515,9 @@ public class XSSFSheetXMLHandler extends DefaultHandler {
public void cell(String cellReference, String formattedValue, XSSFComment comment); public void cell(String cellReference, String formattedValue, XSSFComment comment);
/** A header or footer has been encountered */ /** 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 */ /** Signal that the end of a sheet was been reached */
public void endSheet(); public default void endSheet() {}
} }
} }

View File

@ -342,10 +342,6 @@ public class XSSFEventBasedExcelExtractor extends POIXMLTextExtractor
output.append('\n'); output.append('\n');
} }
@Override
public void endSheet() {
}
@Override @Override
public void cell(String cellRef, String formattedValue, XSSFComment comment) { public void cell(String cellRef, String formattedValue, XSSFComment comment) {
if(firstCellOfRow) { if(firstCellOfRow) {