mirror of https://github.com/apache/poi.git
Remove old XSSFWorkbook wb.xssfSheetIterator method
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1800248 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0b758698a5
commit
586b303d74
|
@ -1238,74 +1238,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xssfSheetIterator was added to make transitioning to the new Iterator<Sheet> iterator()
|
||||
* interface less painful for projects currently using POI.
|
||||
*
|
||||
* If your code was written using a for-each loop:
|
||||
* <pre><code>
|
||||
* for (XSSFSheet sh : wb) {
|
||||
* sh.createRow(0);
|
||||
* }
|
||||
* </code></pre>
|
||||
*
|
||||
* There are two ways to upgrade your code:
|
||||
* // Option A:
|
||||
* <pre><code>
|
||||
* for (XSSFSheet sh : (Iterable<XSSFSheet>) (Iterable<? extends Sheet>) wb) {
|
||||
* sh.createRow(0);
|
||||
* }
|
||||
* </code></pre>
|
||||
*
|
||||
* // Option B (preferred for new code):
|
||||
* <pre><code>
|
||||
* for (Sheet sh : wb) {
|
||||
* sh.createRow(0);
|
||||
* }
|
||||
* </code></pre>
|
||||
*
|
||||
*
|
||||
*
|
||||
* If your code was written using an iterator variable:
|
||||
* <pre><code>
|
||||
* Iterator<XSSFSheet> it = wb.iterator();
|
||||
* XSSFSheet sh = it.next();
|
||||
* sh.createRow(0);
|
||||
* </code></pre>
|
||||
*
|
||||
* There are three ways to upgrade your code:
|
||||
* // Option A:
|
||||
* <pre><code>
|
||||
* Iterator<XSSFSheet> it = (Iterator<XSSFSheet>) (Iterator<? extends Sheet>) wb.iterator();
|
||||
* XSSFSheet sh = it.next();
|
||||
* sh.createRow(0);
|
||||
* </code></pre>
|
||||
*
|
||||
* // Option B:
|
||||
* <pre><code>
|
||||
* @SuppressWarnings("deprecation")
|
||||
* Iterator<XSSFSheet> it = wb.xssfSheetIterator();
|
||||
* XSSFSheet sh = it.next();
|
||||
* sh.createRow(0);
|
||||
* </code></pre>
|
||||
*
|
||||
* // Option C (preferred for new code):
|
||||
* <pre><code>
|
||||
* Iterator<Sheet> it = wb.iterator();
|
||||
* Sheet sh = it.next();
|
||||
* sh.createRow(0);
|
||||
* </code></pre>
|
||||
*
|
||||
* @deprecated 3.13. New projects should use the preferred options. Note: XSSFWorkbook.xssfSheetIterator
|
||||
* is deprecated and will be removed in 3.15.
|
||||
*
|
||||
* @return an iterator of the sheets.
|
||||
*/
|
||||
@Deprecated
|
||||
public Iterator<XSSFSheet> xssfSheetIterator() {
|
||||
return new SheetIterator<XSSFSheet>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Are we a normal workbook (.xlsx), or a
|
||||
* macro enabled workbook (.xlsm)?
|
||||
|
|
|
@ -52,7 +52,6 @@ import org.apache.poi.openxml4j.opc.PackagingURIHelper;
|
|||
import org.apache.poi.openxml4j.opc.internal.FileHelper;
|
||||
import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart;
|
||||
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart;
|
||||
import org.apache.poi.ss.SpreadsheetVersion;
|
||||
import org.apache.poi.ss.usermodel.BaseTestXWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
|
@ -999,15 +998,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
|
|||
sh.createRow(0);
|
||||
}
|
||||
|
||||
// Option B:
|
||||
{
|
||||
@SuppressWarnings("deprecation")
|
||||
Iterator<XSSFSheet> it = wb.xssfSheetIterator();
|
||||
XSSFSheet sh = it.next();
|
||||
sh.createRow(0);
|
||||
}
|
||||
|
||||
// Option C (preferred for new code):
|
||||
// Option B (preferred for new code):
|
||||
{
|
||||
Iterator<Sheet> it = wb.iterator();
|
||||
Sheet sh = it.next();
|
||||
|
|
|
@ -20,7 +20,6 @@ import java.io.File;
|
|||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
|
|
|
@ -36,7 +36,6 @@ import org.apache.poi.ss.ITestDataProvider;
|
|||
import org.apache.poi.ss.util.CellAddress;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.ss.util.CellReference;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue