bug 59873: add @Removal annotations for deprecated CreationHelper#createHyperlink(int) and Hyperlink static aliases to HyperlinkType enum values

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1760621 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-09-14 03:17:51 +00:00
parent b91b5c5715
commit 808996a683
7 changed files with 20 additions and 0 deletions

View File

@ -16,6 +16,8 @@
==================================================================== */
package org.apache.poi.common.usermodel;
import org.apache.poi.util.Removal;
/**
* Represents a hyperlink.
*/
@ -25,6 +27,7 @@ public interface Hyperlink {
*
* @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#URL} instead.
*/
@Removal(version="3.17")
public static final int LINK_URL = 1; // HyperlinkType.URL.getCode()
/**
@ -32,6 +35,7 @@ public interface Hyperlink {
*
* @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#DOCUMENT} instead.
*/
@Removal(version="3.17")
public static final int LINK_DOCUMENT = 2; // HyperlinkType.DOCUMENT.getCode()
/**
@ -39,6 +43,7 @@ public interface Hyperlink {
*
* @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#EMAIL} instead.
*/
@Removal(version="3.17")
public static final int LINK_EMAIL = 3; // HyperlinkType.EMAIL.getCode()
/**
@ -46,6 +51,7 @@ public interface Hyperlink {
*
* @deprecated POI 3.15 beta 3. Use {@link HyperlinkType#FILE} instead.
*/
@Removal(version="3.17")
public static final int LINK_FILE = 4; // HyperlinkType.FILE.getCode()
@ -83,6 +89,7 @@ public interface Hyperlink {
* @return the type of this hyperlink
* @see HyperlinkType#forInt(int)
* @deprecated POI 3.15 beta 3. Use {@link #getTypeEnum()}
* getType will return a HyperlinkType enum in the future.
*/
public int getType();

View File

@ -21,6 +21,7 @@ import org.apache.poi.common.usermodel.HyperlinkType;
import org.apache.poi.hssf.record.common.ExtendedColor;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.util.Internal;
import org.apache.poi.util.Removal;
public class HSSFCreationHelper implements CreationHelper {
private final HSSFWorkbook workbook;
@ -50,6 +51,7 @@ public class HSSFCreationHelper implements CreationHelper {
* @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead.
*/
@Deprecated
@Removal(version="3.17")
@Override
public HSSFHyperlink createHyperlink(int type) {
return new HSSFHyperlink(type);

View File

@ -273,6 +273,8 @@ public class HSSFHyperlink implements Hyperlink {
*
* @return the type of this hyperlink
* @see HyperlinkType#forInt
* @deprecated POI 3.15. Use {@link #getTypeEnum()} instead.
* getType will return a HyperlinkType enum in the future.
*/
@Override
public int getType() {

View File

@ -69,6 +69,10 @@ public class XSLFHyperlink implements Hyperlink<XSLFShape,XSLFTextParagraph> {
_link.setTooltip(label);
}
/* (non-Javadoc)
* @deprecated POI 3.15. Use {@link #getTypeEnum()} instead.
* Will return a HyperlinkType enum in the future
*/
@Override
public int getType() {
return getTypeEnum().getCode();

View File

@ -26,6 +26,7 @@ import org.apache.poi.ss.usermodel.Hyperlink;
import org.apache.poi.util.Internal;
import org.apache.poi.util.POILogFactory;
import org.apache.poi.util.POILogger;
import org.apache.poi.util.Removal;
import org.apache.poi.xssf.usermodel.XSSFCreationHelper;
import org.apache.poi.xssf.usermodel.XSSFRichTextString;
@ -72,6 +73,7 @@ public class SXSSFCreationHelper implements CreationHelper {
* @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead.
*/
@Deprecated
@Removal(version="3.17")
@Override
public Hyperlink createHyperlink(int type) {
return helper.createHyperlink(type);

View File

@ -20,6 +20,7 @@ import org.apache.poi.common.usermodel.HyperlinkType;
import org.apache.poi.ss.usermodel.CreationHelper;
import org.apache.poi.ss.usermodel.Hyperlink;
import org.apache.poi.util.Internal;
import org.apache.poi.util.Removal;
public class XSSFCreationHelper implements CreationHelper {
private final XSSFWorkbook workbook;
@ -61,6 +62,7 @@ public class XSSFCreationHelper implements CreationHelper {
* @deprecated POI 3.15 beta 3. Use {@link #createHyperlink(HyperlinkType)} instead.
*/
@Deprecated
@Removal(version="3.17")
@Override
public XSSFHyperlink createHyperlink(int type) {
return new XSSFHyperlink(type);

View File

@ -168,6 +168,7 @@ public class XSSFHyperlink implements Hyperlink {
* @return the type of this hyperlink
* @see HyperlinkType#forInt
* @deprecated POI 3.15 beta 3. Use {@link #getTypeEnum()} instead.
* getType will return a HyperlinkType enum in the future.
*/
@Override
public int getType() {