summaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2017-10-22 13:03:33 +0000
committerPJ Fanning <fanningpj@apache.org>2017-10-22 13:03:33 +0000
commite52d29df16a661545bd9a0acc14f5255baf57589 (patch)
treef075e541e5ab94e6063df7a3205f1c8fc38a28d2 /src/java
parent2cd8c7bc6568238ea504b50566ac8c812827948b (diff)
downloadpoi-e52d29df16a661545bd9a0acc14f5255baf57589.tar.gz
poi-e52d29df16a661545bd9a0acc14f5255baf57589.zip
Remove use of deprecated methods
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1812911 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java90
-rw-r--r--src/java/org/apache/poi/ss/usermodel/CellStyle.java34
-rw-r--r--src/java/org/apache/poi/ss/util/CellUtil.java8
3 files changed, 44 insertions, 88 deletions
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
index 2e6c5b5c54..64a0d12e98 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java
@@ -408,28 +408,15 @@ public final class HSSFCellStyle implements CellStyle {
_format.setBorderLeft(border.getCode());
}
- /**
- * get the type of border to use for the left border of the cell
- * @return border type
- * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderLeftEnum()}.
- */
- @Deprecated
@Override
- public short getBorderLeft()
- {
- return _format.getBorderLeft();
- }
- /**
- * get the type of border to use for the left border of the cell
- * @return border type
- * @since POI 3.15
- */
- @Override
- public BorderStyle getBorderLeftEnum()
+ public BorderStyle getBorderLeft()
{
return BorderStyle.valueOf(_format.getBorderLeft());
}
-
+
+ @Override
+ public BorderStyle getBorderLeftEnum() { return getBorderLeft(); }
+
/**
* set the type of border to use for the right border of the cell
* @param border type
@@ -442,28 +429,15 @@ public final class HSSFCellStyle implements CellStyle {
_format.setBorderRight(border.getCode());
}
- /**
- * get the type of border to use for the right border of the cell
- * @return border type
- * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderRightEnum()}.
- */
- @Deprecated
@Override
- public short getBorderRight()
- {
- return _format.getBorderRight();
- }
- /**
- * get the type of border to use for the right border of the cell
- * @return border type
- * @since POI 3.15
- */
- @Override
- public BorderStyle getBorderRightEnum()
+ public BorderStyle getBorderRight()
{
return BorderStyle.valueOf(_format.getBorderRight());
}
-
+
+ @Override
+ public BorderStyle getBorderRightEnum() { return getBorderRight(); }
+
/**
* set the type of border to use for the top border of the cell
* @param border type
@@ -476,28 +450,15 @@ public final class HSSFCellStyle implements CellStyle {
_format.setBorderTop(border.getCode());
}
- /**
- * get the type of border to use for the top border of the cell
- * @return border type
- * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderTopEnum()}.
- */
- @Deprecated
@Override
- public short getBorderTop()
- {
- return _format.getBorderTop();
- }
- /**
- * get the type of border to use for the top border of the cell
- * @return border type
- * @since 3.15
- */
- @Override
- public BorderStyle getBorderTopEnum()
+ public BorderStyle getBorderTop()
{
return BorderStyle.valueOf(_format.getBorderTop());
}
-
+
+ @Override
+ public BorderStyle getBorderTopEnum() { return getBorderTop(); }
+
/**
* set the type of border to use for the bottom border of the cell
* @param border type
@@ -510,28 +471,15 @@ public final class HSSFCellStyle implements CellStyle {
_format.setBorderBottom(border.getCode());
}
- /**
- * get the type of border to use for the bottom border of the cell
- * @return border type
- * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderBottomEnum()}.
- */
- @Deprecated
@Override
- public short getBorderBottom()
- {
- return _format.getBorderBottom();
- }
- /**
- * get the type of border to use for the bottom border of the cell
- * @return border type
- * @since 3.15
- */
- @Override
- public BorderStyle getBorderBottomEnum()
+ public BorderStyle getBorderBottom()
{
return BorderStyle.valueOf(_format.getBorderBottom());
}
+ @Override
+ public BorderStyle getBorderBottomEnum() { return getBorderBottom(); }
+
/**
* set the color to use for the left border
* @param color The index of the color definition
diff --git a/src/java/org/apache/poi/ss/usermodel/CellStyle.java b/src/java/org/apache/poi/ss/usermodel/CellStyle.java
index e260edfff2..cebdcf3047 100644
--- a/src/java/org/apache/poi/ss/usermodel/CellStyle.java
+++ b/src/java/org/apache/poi/ss/usermodel/CellStyle.java
@@ -208,15 +208,17 @@ public interface CellStyle {
/**
* get the type of border to use for the left border of the cell
* @return border type
- * @deprecated POI 3.15. Use {@link #getBorderLeftEnum()} instead.
- * This will return a BorderStyle enum in the future.
+ * @since POI 4.0.0
*/
- short getBorderLeft();
+ BorderStyle getBorderLeft();
+
/**
* get the type of border to use for the left border of the cell
* @return border type
* @since POI 3.15
+ * @deprecated use <code>getBorderLeft()</code> instead
*/
+ @Removal(version = "4.2")
BorderStyle getBorderLeftEnum();
/**
@@ -229,15 +231,17 @@ public interface CellStyle {
/**
* get the type of border to use for the right border of the cell
* @return border type
- * @deprecated POI 3.15. Use {@link #getBorderRightEnum()} instead.
- * This will return a BorderStyle enum in the future.
+ * @since POI 4.0.0
*/
- short getBorderRight();
+ BorderStyle getBorderRight();
+
/**
* get the type of border to use for the right border of the cell
* @return border type
* @since POI 3.15
+ * @deprecated use <code>getBorderRight()</code> instead
*/
+ @Removal(version = "4.2")
BorderStyle getBorderRightEnum();
/**
@@ -250,17 +254,19 @@ public interface CellStyle {
/**
* get the type of border to use for the top border of the cell
* @return border type
- * @deprecated POI 3.15. Use {@link #getBorderTopEnum()} instead.
- * This will return a BorderStyle enum in the future.
+ * @since POI 4.0.0
*/
- short getBorderTop();
+ BorderStyle getBorderTop();
+
/**
* get the type of border to use for the top border of the cell
* @return border type
* @since POI 3.15
+ * @deprecated use <code>getBorderTop()</code> instead
*/
+ @Removal(version = "4.2")
BorderStyle getBorderTopEnum();
-
+
/**
* set the type of border to use for the bottom border of the cell
* @param border type
@@ -271,15 +277,17 @@ public interface CellStyle {
/**
* get the type of border to use for the bottom border of the cell
* @return border type
- * @deprecated POI 3.15. Use {@link #getBorderBottomEnum()} instead.
- * This will return a BorderStyle enum in the future.
+ * @since POI 4.0.0
*/
- short getBorderBottom();
+ BorderStyle getBorderBottom();
+
/**
* get the type of border to use for the bottom border of the cell
* @return border type
* @since POI 3.15
+ * @deprecated use <code>getBorderBottom()</code> instead
*/
+ @Removal(version = "4.2")
BorderStyle getBorderBottomEnum();
/**
diff --git a/src/java/org/apache/poi/ss/util/CellUtil.java b/src/java/org/apache/poi/ss/util/CellUtil.java
index 1b765b9401..e1b909917a 100644
--- a/src/java/org/apache/poi/ss/util/CellUtil.java
+++ b/src/java/org/apache/poi/ss/util/CellUtil.java
@@ -337,10 +337,10 @@ public final class CellUtil {
Map<String, Object> properties = new HashMap<>();
put(properties, ALIGNMENT, style.getAlignment());
put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignment());
- put(properties, BORDER_BOTTOM, style.getBorderBottomEnum());
- put(properties, BORDER_LEFT, style.getBorderLeftEnum());
- put(properties, BORDER_RIGHT, style.getBorderRightEnum());
- put(properties, BORDER_TOP, style.getBorderTopEnum());
+ put(properties, BORDER_BOTTOM, style.getBorderBottom());
+ put(properties, BORDER_LEFT, style.getBorderLeft());
+ put(properties, BORDER_RIGHT, style.getBorderRight());
+ put(properties, BORDER_TOP, style.getBorderTop());
put(properties, BOTTOM_BORDER_COLOR, style.getBottomBorderColor());
put(properties, DATA_FORMAT, style.getDataFormat());
put(properties, FILL_PATTERN, style.getFillPattern());