From: Javen O'Neal Date: Mon, 28 Dec 2015 00:52:47 +0000 (+0000) Subject: bug 58740: add @Internal annotations and decrease access level to methods that only... X-Git-Tag: REL_3_14_FINAL~168 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=64997c65078403d5f4f80e6de4464fed41a7c464;p=poi.git bug 58740: add @Internal annotations and decrease access level to methods that only exist for unit testing git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1721864 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java b/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java index 3c40725ad6..4561001436 100644 --- a/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/model/StylesTable.java @@ -37,6 +37,7 @@ import org.apache.poi.ss.SpreadsheetVersion; import org.apache.poi.ss.usermodel.BuiltinFormats; import org.apache.poi.ss.usermodel.FontFamily; import org.apache.poi.ss.usermodel.FontScheme; +import org.apache.poi.util.Internal; import org.apache.poi.xssf.usermodel.XSSFCellStyle; import org.apache.poi.xssf.usermodel.XSSFFactory; import org.apache.poi.xssf.usermodel.XSSFFont; @@ -326,25 +327,35 @@ public class StylesTable extends POIXMLDocumentPart { return fills.size() - 1; } + @Internal public CTXf getCellXfAt(int idx) { return xfs.get(idx); } + + @Internal public int putCellXf(CTXf cellXf) { xfs.add(cellXf); return xfs.size(); } + + @Internal public void replaceCellXfAt(int idx, CTXf cellXf) { xfs.set(idx, cellXf); } + @Internal public CTXf getCellStyleXfAt(int idx) { return idx < styleXfs.size() ? styleXfs.get(idx) : null; } + + @Internal public int putCellStyleXf(CTXf cellStyleXf) { styleXfs.add(cellStyleXf); return styleXfs.size(); } - public void replaceCellStyleXfAt(int idx, CTXf cellStyleXf) { + + @Internal + protected void replaceCellStyleXfAt(int idx, CTXf cellStyleXf) { styleXfs.set(idx, cellStyleXf); } @@ -360,6 +371,7 @@ public class StylesTable extends POIXMLDocumentPart { /** * For unit testing only */ + @Internal public int _getNumberFormatSize() { return numberFormats.size(); } @@ -367,21 +379,27 @@ public class StylesTable extends POIXMLDocumentPart { /** * For unit testing only */ - public int _getXfsSize() { + @Internal + /*package*/ int _getXfsSize() { return xfs.size(); } /** * For unit testing only */ + @Internal public int _getStyleXfsSize() { return styleXfs.size(); } + /** * For unit testing only! */ + @Internal public CTStylesheet getCTStylesheet() { return doc.getStyleSheet(); } + + @Internal public int _getDXfsSize() { return dxfs.size(); } @@ -553,15 +571,22 @@ public class StylesTable extends POIXMLDocumentPart { return xssfFont; } + @Internal public CTDxf getDxfAt(int idx) { return dxfs.get(idx); } + @Internal public int putDxf(CTDxf dxf) { this.dxfs.add(dxf); return this.dxfs.size(); } + /** + * Create a cell style in this style table. + * Note - End users probably want to call {@link XSSFWorkbook#createCellStyle()} + * rather than working with the styles table directly. + */ public XSSFCellStyle createCellStyle() { if (getNumCellStyles() > MAXIMUM_STYLE_ID) { throw new IllegalStateException("The maximum number of Cell Styles was exceeded. " +