From 1ff463ffb67900314c10b94657916d394b04f90f Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Wed, 14 Sep 2016 05:51:52 +0000 Subject: [PATCH] bug 59791: add deprecation and removal annotations git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760634 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/ss/format/CellFormat.java | 32 +++++++++++-------- .../apache/poi/xssf/streaming/SXSSFCell.java | 3 ++ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/java/org/apache/poi/ss/format/CellFormat.java b/src/java/org/apache/poi/ss/format/CellFormat.java index e47d40c4f1..bad8497126 100644 --- a/src/java/org/apache/poi/ss/format/CellFormat.java +++ b/src/java/org/apache/poi/ss/format/CellFormat.java @@ -35,7 +35,6 @@ import org.apache.poi.ss.usermodel.ConditionalFormattingRule; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.util.DateFormatConverter; -import org.apache.poi.util.Internal; /** * Format a value according to the standard Excel behavior. This "standard" is @@ -44,28 +43,35 @@ import org.apache.poi.util.Internal; *

* An Excel format has up to four parts, separated by semicolons. Each part * specifies what to do with particular kinds of values, depending on the number - * of parts given:

One part (example: [Green]#.##)
If the - * value is a number, display according to this one part (example: green text, - * with up to two decimal points). If the value is text, display it as is. - *
Two parts (example: [Green]#.##;[Red]#.##)
If the value is a - * positive number or zero, display according to the first part (example: green + * of parts given: + *
+ *
One part (example: [Green]#.##)
+ *
If the value is a number, display according to this one part (example: green text, + * with up to two decimal points). If the value is text, display it as is.
+ * + *
Two parts (example: [Green]#.##;[Red]#.##)
+ *
If the value is a positive number or zero, display according to the first part (example: green * text, with up to two decimal points); if it is a negative number, display * according to the second part (example: red text, with up to two decimal - * points). If the value is text, display it as is.
Three parts (example: - * [Green]#.##;[Black]#.##;[Red]#.##)
If the value is a positive + * points). If the value is text, display it as is.
+ * + *
Three parts (example: [Green]#.##;[Black]#.##;[Red]#.##)
+ *
If the value is a positive * number, display according to the first part (example: green text, with up to * two decimal points); if it is zero, display according to the second part * (example: black text, with up to two decimal points); if it is a negative * number, display according to the third part (example: red text, with up to - * two decimal points). If the value is text, display it as is.
Four parts - * (example: [Green]#.##;[Black]#.##;[Red]#.##;[@])
If the value is - * a positive number, display according to the first part (example: green text, + * two decimal points). If the value is text, display it as is.
+ * + *
Four parts (example: [Green]#.##;[Black]#.##;[Red]#.##;[@])
+ *
If the value is a positive number, display according to the first part (example: green text, * with up to two decimal points); if it is zero, display according to the * second part (example: black text, with up to two decimal points); if it is a * negative number, display according to the third part (example: red text, with * up to two decimal points). If the value is text, display according to the * fourth part (example: text in the cell's usual color, with the text value - * surround by brackets).
+ * surround by brackets).
+ *
*

* A given format part may specify a given Locale, by including something * like [$$-409] or [$£-809] or [$-40C]. These @@ -421,6 +427,7 @@ public class CellFormat { * @param cell The cell. * * @return The ultimate type of this cell. + * @deprecated POI 3.15. This will return a CellType enum in the future */ public static int ultimateType(Cell cell) { return ultimateTypeEnum(cell).getCode(); @@ -439,7 +446,6 @@ public class CellFormat { * @deprecated POI 3.15 beta 3 * Will be deleted when we make the CellType enum transition. See bug 59791. */ - @Internal(since="POI 3.15 beta 3") public static CellType ultimateTypeEnum(Cell cell) { CellType type = cell.getCellTypeEnum(); if (type == CellType.FORMULA) diff --git a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCell.java b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCell.java index 6174af54ba..99a4648a7c 100644 --- a/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCell.java +++ b/src/ooxml/java/org/apache/poi/xssf/streaming/SXSSFCell.java @@ -43,6 +43,7 @@ import org.apache.poi.util.LocaleUtil; import org.apache.poi.util.NotImplemented; import org.apache.poi.util.POILogFactory; import org.apache.poi.util.POILogger; +import org.apache.poi.util.Removal; import org.apache.poi.xssf.usermodel.XSSFHyperlink; import org.apache.poi.xssf.usermodel.XSSFRichTextString; @@ -61,6 +62,8 @@ public class SXSSFCell implements Cell { * @deprecated POI 3.15 beta 3. * Will be deleted when we make the CellType enum transition. See bug 59791. */ + @Removal(version="3.17") + @Deprecated public SXSSFCell(SXSSFRow row, int cellType) { this(row, CellType.forInt((cellType))); -- 2.39.5