Compiler/IDE warnings, unnecessary keywords,

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1761675 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2016-09-21 05:45:57 +00:00
parent 55897d8815
commit e6a2d46800
14 changed files with 111 additions and 92 deletions

View File

@ -26,308 +26,308 @@ public interface CellStyle {
* @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#GENERAL} instead. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#GENERAL} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALIGN_GENERAL = 0x0; //HorizontalAlignment.GENERAL.getCode(); short ALIGN_GENERAL = 0x0; //HorizontalAlignment.GENERAL.getCode();
/** /**
* left-justified horizontal alignment * left-justified horizontal alignment
* @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#LEFT} instead. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#LEFT} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALIGN_LEFT = 0x1; //HorizontalAlignment.LEFT.getCode(); short ALIGN_LEFT = 0x1; //HorizontalAlignment.LEFT.getCode();
/** /**
* center horizontal alignment * center horizontal alignment
* @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#CENTER} instead. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#CENTER} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALIGN_CENTER = 0x2; //HorizontalAlignment.CENTER.getCode(); short ALIGN_CENTER = 0x2; //HorizontalAlignment.CENTER.getCode();
/** /**
* right-justified horizontal alignment * right-justified horizontal alignment
* @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#RIGHT} instead. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#RIGHT} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALIGN_RIGHT = 0x3; //HorizontalAlignment.RIGHT.getCode(); short ALIGN_RIGHT = 0x3; //HorizontalAlignment.RIGHT.getCode();
/** /**
* fill? horizontal alignment * fill? horizontal alignment
* @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#FILL} instead. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#FILL} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALIGN_FILL = 0x4; //HorizontalAlignment.FILL.getCode(); short ALIGN_FILL = 0x4; //HorizontalAlignment.FILL.getCode();
/** /**
* justified horizontal alignment * justified horizontal alignment
* @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#JUSTIFY} instead. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#JUSTIFY} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALIGN_JUSTIFY = 0x5; //HorizontalAlignment.JUSTIFY.getCode(); short ALIGN_JUSTIFY = 0x5; //HorizontalAlignment.JUSTIFY.getCode();
/** /**
* center-selection? horizontal alignment * center-selection? horizontal alignment
* @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#CENTER_SELECTION} instead. * @deprecated POI 3.15 beta 3. Use {@link HorizontalAlignment#CENTER_SELECTION} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALIGN_CENTER_SELECTION = 0x6; //HorizontalAlignment.CENTER_SELECTION.getCode(); short ALIGN_CENTER_SELECTION = 0x6; //HorizontalAlignment.CENTER_SELECTION.getCode();
/** /**
* top-aligned vertical alignment * top-aligned vertical alignment
* @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#TOP} instead. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#TOP} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short VERTICAL_TOP = 0x0; //VerticalAlignment.TOP.getCode(); short VERTICAL_TOP = 0x0; //VerticalAlignment.TOP.getCode();
/** /**
* center-aligned vertical alignment * center-aligned vertical alignment
* @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#CENTER} instead. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#CENTER} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short VERTICAL_CENTER = 0x1; //VerticalAlignment.CENTER.getCode(); short VERTICAL_CENTER = 0x1; //VerticalAlignment.CENTER.getCode();
/** /**
* bottom-aligned vertical alignment * bottom-aligned vertical alignment
* @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#BOTTOM} instead. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#BOTTOM} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short VERTICAL_BOTTOM = 0x2; //VerticalAlignment.BOTTOM.getCode(); short VERTICAL_BOTTOM = 0x2; //VerticalAlignment.BOTTOM.getCode();
/** /**
* vertically justified vertical alignment * vertically justified vertical alignment
* @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#JUSTIFY} instead. * @deprecated POI 3.15 beta 3. Use {@link VerticalAlignment#JUSTIFY} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short VERTICAL_JUSTIFY = 0x3; //VerticalAlignment.JUSTIFY.getCode(); short VERTICAL_JUSTIFY = 0x3; //VerticalAlignment.JUSTIFY.getCode();
/** /**
* No border * No border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#NONE} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#NONE} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_NONE = 0x0; //BorderStyle.NONE.getCode(); short BORDER_NONE = 0x0; //BorderStyle.NONE.getCode();
/** /**
* Thin border * Thin border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#THIN} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#THIN} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_THIN = 0x1; //BorderStyle.THIN.getCode(); short BORDER_THIN = 0x1; //BorderStyle.THIN.getCode();
/** /**
* Medium border * Medium border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_MEDIUM = 0x2; //BorderStyle.MEDIUM.getCode(); short BORDER_MEDIUM = 0x2; //BorderStyle.MEDIUM.getCode();
/** /**
* dash border * dash border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#DASHED} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DASHED} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_DASHED = 0x3; //BorderStyle.DASHED.getCode(); short BORDER_DASHED = 0x3; //BorderStyle.DASHED.getCode();
/** /**
* dot border * dot border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#DOTTED} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DOTTED} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_DOTTED = 0x4; //BorderStyle.DOTTED.getCode(); short BORDER_DOTTED = 0x4; //BorderStyle.DOTTED.getCode();
/** /**
* Thick border * Thick border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#THICK} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#THICK} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_THICK = 0x5; //BorderStyle.THICK.getCode(); short BORDER_THICK = 0x5; //BorderStyle.THICK.getCode();
/** /**
* double-line border * double-line border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#DOUBLE} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DOUBLE} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_DOUBLE = 0x6; //BorderStyle.DOUBLE.getCode(); short BORDER_DOUBLE = 0x6; //BorderStyle.DOUBLE.getCode();
/** /**
* hair-line border * hair-line border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#HAIR} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#HAIR} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_HAIR = 0x7; //BorderStyle.HAIR.getCode(); short BORDER_HAIR = 0x7; //BorderStyle.HAIR.getCode();
/** /**
* Medium dashed border * Medium dashed border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASHED} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASHED} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_MEDIUM_DASHED = 0x8; //BorderStyle.MEDIUM_DASHED.getCode(); short BORDER_MEDIUM_DASHED = 0x8; //BorderStyle.MEDIUM_DASHED.getCode();
/** /**
* dash-dot border * dash-dot border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#DASH_DOT} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DASH_DOT} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_DASH_DOT = 0x9; //BorderStyle.DASH_DOT.getCode(); short BORDER_DASH_DOT = 0x9; //BorderStyle.DASH_DOT.getCode();
/** /**
* medium dash-dot border * medium dash-dot border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASH_DOT} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASH_DOT} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_MEDIUM_DASH_DOT = 0xA; //BorderStyle.MEDIUM_DASH_DOT.getCode(); short BORDER_MEDIUM_DASH_DOT = 0xA; //BorderStyle.MEDIUM_DASH_DOT.getCode();
/** /**
* dash-dot-dot border * dash-dot-dot border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#DASH_DOT_DOT} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#DASH_DOT_DOT} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_DASH_DOT_DOT = 0xB; //BorderStyle.DASH_DOT_DOT.getCode(); short BORDER_DASH_DOT_DOT = 0xB; //BorderStyle.DASH_DOT_DOT.getCode();
/** /**
* medium dash-dot-dot border * medium dash-dot-dot border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASH_DOT_DOT} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#MEDIUM_DASH_DOT_DOT} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_MEDIUM_DASH_DOT_DOT = 0xC; //BorderStyle.MEDIUM_DASH_DOT_DOT.getCode(); short BORDER_MEDIUM_DASH_DOT_DOT = 0xC; //BorderStyle.MEDIUM_DASH_DOT_DOT.getCode();
/** /**
* slanted dash-dot border * slanted dash-dot border
* @deprecated 3.15 beta 2. Use {@link BorderStyle#SLANTED_DASH_DOT} instead. * @deprecated 3.15 beta 2. Use {@link BorderStyle#SLANTED_DASH_DOT} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BORDER_SLANTED_DASH_DOT = 0xD; //BorderStyle.SLANTED_DASH_DOT.getCode(); short BORDER_SLANTED_DASH_DOT = 0xD; //BorderStyle.SLANTED_DASH_DOT.getCode();
/** /**
* Fill Pattern: No background * Fill Pattern: No background
* @deprecated 3.15 beta 3. Use {@link FillPatternType#NO_FILL} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#NO_FILL} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short NO_FILL = 0; //FillPatternType.NO_FILL.getCode(); short NO_FILL = 0; //FillPatternType.NO_FILL.getCode();
/** /**
* Fill Pattern: Solidly filled * Fill Pattern: Solidly filled
* @deprecated 3.15 beta 3. Use {@link FillPatternType#SOLID_FOREGROUND} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#SOLID_FOREGROUND} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short SOLID_FOREGROUND = 1; //FillPatternType.SOLID_FOREGROUND.getCode(); short SOLID_FOREGROUND = 1; //FillPatternType.SOLID_FOREGROUND.getCode();
/** /**
* Fill Pattern: Small fine dots * Fill Pattern: Small fine dots
* @deprecated 3.15 beta 3. Use {@link FillPatternType#FINE_DOTS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#FINE_DOTS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short FINE_DOTS = 2; //FillPatternType.FINE_DOTS.getCode(); short FINE_DOTS = 2; //FillPatternType.FINE_DOTS.getCode();
/** /**
* Fill Pattern: Wide dots * Fill Pattern: Wide dots
* @deprecated 3.15 beta 3. Use {@link FillPatternType#ALT_BARS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#ALT_BARS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short ALT_BARS = 3; //FillPatternType.ALT_BARS.getCode(); short ALT_BARS = 3; //FillPatternType.ALT_BARS.getCode();
/** /**
* Fill Pattern: Sparse dots * Fill Pattern: Sparse dots
* @deprecated 3.15 beta 3. Use {@link FillPatternType#SPARSE_DOTS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#SPARSE_DOTS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short SPARSE_DOTS = 4; //FillPatternType.SPARSE_DOTS.getCode(); short SPARSE_DOTS = 4; //FillPatternType.SPARSE_DOTS.getCode();
/** /**
* Fill Pattern: Thick horizontal bands * Fill Pattern: Thick horizontal bands
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_HORZ_BANDS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_HORZ_BANDS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THICK_HORZ_BANDS = 5; //FillPatternType.THICK_HORZ_BANDS.getCode(); short THICK_HORZ_BANDS = 5; //FillPatternType.THICK_HORZ_BANDS.getCode();
/** /**
* Fill Pattern: Thick vertical bands * Fill Pattern: Thick vertical bands
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_VERT_BANDS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_VERT_BANDS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THICK_VERT_BANDS = 6; //FillPatternType.THICK_VERT_BANDS.getCode(); short THICK_VERT_BANDS = 6; //FillPatternType.THICK_VERT_BANDS.getCode();
/** /**
* Fill Pattern: Thick backward facing diagonals * Fill Pattern: Thick backward facing diagonals
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_BACKWARD_DIAG} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_BACKWARD_DIAG} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THICK_BACKWARD_DIAG = 7; //FillPatternType.THICK_BACKWARD_DIAG.getCode(); short THICK_BACKWARD_DIAG = 7; //FillPatternType.THICK_BACKWARD_DIAG.getCode();
/** /**
* Fill Pattern: Thick forward facing diagonals * Fill Pattern: Thick forward facing diagonals
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_FORWARD_DIAG} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THICK_FORWARD_DIAG} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THICK_FORWARD_DIAG = 8; //FillPatternType.THICK_FORWARD_DIAG.getCode(); short THICK_FORWARD_DIAG = 8; //FillPatternType.THICK_FORWARD_DIAG.getCode();
/** /**
* Fill Pattern: Large spots * Fill Pattern: Large spots
* @deprecated 3.15 beta 3. Use {@link FillPatternType#BIG_SPOTS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#BIG_SPOTS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BIG_SPOTS = 9; //FillPatternType.BIG_SPOTS.getCode(); short BIG_SPOTS = 9; //FillPatternType.BIG_SPOTS.getCode();
/** /**
* Fill Pattern: Brick-like layout * Fill Pattern: Brick-like layout
* @deprecated 3.15 beta 3. Use {@link FillPatternType#BRICKS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#BRICKS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short BRICKS = 10; //FillPatternType.BRICKS.getCode(); short BRICKS = 10; //FillPatternType.BRICKS.getCode();
/** /**
* Fill Pattern: Thin horizontal bands * Fill Pattern: Thin horizontal bands
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_HORZ_BANDS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_HORZ_BANDS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THIN_HORZ_BANDS = 11; //FillPatternType.THIN_HORZ_BANDS.getCode(); short THIN_HORZ_BANDS = 11; //FillPatternType.THIN_HORZ_BANDS.getCode();
/** /**
* Fill Pattern: Thin vertical bands * Fill Pattern: Thin vertical bands
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_VERT_BANDS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_VERT_BANDS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THIN_VERT_BANDS = 12; //FillPatternType.THIN_VERT_BANDS.getCode(); short THIN_VERT_BANDS = 12; //FillPatternType.THIN_VERT_BANDS.getCode();
/** /**
* Fill Pattern: Thin backward diagonal * Fill Pattern: Thin backward diagonal
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_BACKWARD_DIAG} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_BACKWARD_DIAG} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THIN_BACKWARD_DIAG = 13; //FillPatternType.THIN_BACKWARD_DIAG.getCode(); short THIN_BACKWARD_DIAG = 13; //FillPatternType.THIN_BACKWARD_DIAG.getCode();
/** /**
* Fill Pattern: Thin forward diagonal * Fill Pattern: Thin forward diagonal
* @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_FORWARD_DIAG} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#THIN_FORWARD_DIAG} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short THIN_FORWARD_DIAG = 14; //FillPatternType.THIN_FORWARD_DIAG.getCode(); short THIN_FORWARD_DIAG = 14; //FillPatternType.THIN_FORWARD_DIAG.getCode();
/** /**
* Fill Pattern: Squares * Fill Pattern: Squares
* @deprecated 3.15 beta 3. Use {@link FillPatternType#SQUARES} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#SQUARES} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short SQUARES = 15; //FillPatternType.SQUARES.getCode(); short SQUARES = 15; //FillPatternType.SQUARES.getCode();
/** /**
* Fill Pattern: Diamonds * Fill Pattern: Diamonds
* @deprecated 3.15 beta 3. Use {@link FillPatternType#DIAMONDS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#DIAMONDS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short DIAMONDS = 16; //FillPatternType.DIAMONDS.getCode(); short DIAMONDS = 16; //FillPatternType.DIAMONDS.getCode();
/** /**
* Fill Pattern: Less Dots * Fill Pattern: Less Dots
* @deprecated 3.15 beta 3. Use {@link FillPatternType#LESS_DOTS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#LESS_DOTS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short LESS_DOTS = 17; //FillPatternType.LESS_DOTS.getCode(); short LESS_DOTS = 17; //FillPatternType.LESS_DOTS.getCode();
/** /**
* Fill Pattern: Least Dots * Fill Pattern: Least Dots
* @deprecated 3.15 beta 3. Use {@link FillPatternType#LEAST_DOTS} instead. * @deprecated 3.15 beta 3. Use {@link FillPatternType#LEAST_DOTS} instead.
*/ */
@Removal(version="3.17") @Removal(version="3.17")
static final short LEAST_DOTS = 18; //FillPatternType.LEAST_DOTS.getCode(); short LEAST_DOTS = 18; //FillPatternType.LEAST_DOTS.getCode();
/** /**
* get the index within the Workbook (sequence within the collection of ExtnededFormat objects) * get the index within the Workbook (sequence within the collection of ExtnededFormat objects)
@ -353,7 +353,7 @@ public interface CellStyle {
/** /**
* Get the format string * Get the format string
*/ */
public String getDataFormatString(); String getDataFormatString();
/** /**
* set the font for this style * set the font for this style
@ -870,17 +870,17 @@ public interface CellStyle {
* to be of the same type (HSSFCellStyle or * to be of the same type (HSSFCellStyle or
* XSSFCellStyle) * XSSFCellStyle)
*/ */
public void cloneStyleFrom(CellStyle source); void cloneStyleFrom(CellStyle source);
/** /**
* Controls if the Cell should be auto-sized * Controls if the Cell should be auto-sized
* to shrink to fit if the text is too long * to shrink to fit if the text is too long
*/ */
public void setShrinkToFit(boolean shrinkToFit); void setShrinkToFit(boolean shrinkToFit);
/** /**
* Should the Cell be auto-sized by Excel to shrink * Should the Cell be auto-sized by Excel to shrink
* it to fit if this text is too long? * it to fit if this text is too long?
*/ */
public boolean getShrinkToFit(); boolean getShrinkToFit();
} }

View File

@ -18,6 +18,8 @@
package org.apache.poi.ss.usermodel; package org.apache.poi.ss.usermodel;
import org.apache.poi.ss.formula.eval.ErrorEval; import org.apache.poi.ss.formula.eval.ErrorEval;
import org.apache.poi.util.Internal;
import org.apache.poi.util.Removal;
/** /**
* Mimics the 'data view' of a cell. This allows formula evaluator * Mimics the 'data view' of a cell. This allows formula evaluator
@ -47,12 +49,15 @@ public final class CellValue {
public CellValue(double numberValue) { public CellValue(double numberValue) {
this(CellType.NUMERIC, numberValue, false, null, 0); this(CellType.NUMERIC, numberValue, false, null, 0);
} }
public static CellValue valueOf(boolean booleanValue) { public static CellValue valueOf(boolean booleanValue) {
return booleanValue ? TRUE : FALSE; return booleanValue ? TRUE : FALSE;
} }
public CellValue(String stringValue) { public CellValue(String stringValue) {
this(CellType.STRING, 0.0, false, stringValue, 0); this(CellType.STRING, 0.0, false, stringValue, 0);
} }
public static CellValue getError(int errorCode) { public static CellValue getError(int errorCode) {
return new CellValue(CellType.ERROR, 0.0, false, null, errorCode); return new CellValue(CellType.ERROR, 0.0, false, null, errorCode);
} }
@ -64,30 +69,44 @@ public final class CellValue {
public boolean getBooleanValue() { public boolean getBooleanValue() {
return _booleanValue; return _booleanValue;
} }
/** /**
* @return Returns the numberValue. * @return Returns the numberValue.
*/ */
public double getNumberValue() { public double getNumberValue() {
return _numberValue; return _numberValue;
} }
/** /**
* @return Returns the stringValue. * @return Returns the stringValue.
*/ */
public String getStringValue() { public String getStringValue() {
return _textValue; return _textValue;
} }
/**
* Return the cell type.
*
* @return the cell type
* @since POI 3.15
* @deprecated POI 3.15
* Will be renamed to <code>getCellTypeEnum()</code> when we make the CellType enum transition in POI 4.0. See bug 59791.
*/
@Internal(since="POI 3.15 beta 3")
@Removal(version="4.2")
public CellType getCellTypeEnum() {
return _cellType;
}
/** /**
* @return Returns the cellType. * Return the cell type.
* @since POI 3.15 *
*/ * Will return {@link CellType} in version 4.0 of POI.
public CellType getCellTypeEnum() { * For forwards compatibility, do not hard-code cell type literals in your code.
return _cellType; *
} * @return the cell type
/** *
* @return Returns the cellType.
* @deprecated POI 3.15. Use {@link #getCellTypeEnum()} instead. * @deprecated POI 3.15. Use {@link #getCellTypeEnum()} instead.
* In the future, the signature of this method will be changed to return a
* {@link CellType}.
*/ */
@Deprecated @Deprecated
public int getCellType() { public int getCellType() {
@ -100,6 +119,7 @@ public final class CellValue {
public byte getErrorValue() { public byte getErrorValue() {
return (byte) _errorCode; return (byte) _errorCode;
} }
public String toString() { public String toString() {
StringBuffer sb = new StringBuffer(64); StringBuffer sb = new StringBuffer(64);
sb.append(getClass().getName()).append(" ["); sb.append(getClass().getName()).append(" [");

View File

@ -35,22 +35,22 @@ import org.apache.poi.ss.usermodel.Row.MissingCellPolicy;
public interface Workbook extends Closeable, Iterable<Sheet> { public interface Workbook extends Closeable, Iterable<Sheet> {
/** Extended windows meta file */ /** Extended windows meta file */
public static final int PICTURE_TYPE_EMF = 2; int PICTURE_TYPE_EMF = 2;
/** Windows Meta File */ /** Windows Meta File */
public static final int PICTURE_TYPE_WMF = 3; int PICTURE_TYPE_WMF = 3;
/** Mac PICT format */ /** Mac PICT format */
public static final int PICTURE_TYPE_PICT = 4; int PICTURE_TYPE_PICT = 4;
/** JPEG format */ /** JPEG format */
public static final int PICTURE_TYPE_JPEG = 5; int PICTURE_TYPE_JPEG = 5;
/** PNG format */ /** PNG format */
public static final int PICTURE_TYPE_PNG = 6; int PICTURE_TYPE_PNG = 6;
/** Device independent bitmap */ /** Device independent bitmap */
public static final int PICTURE_TYPE_DIB = 7; int PICTURE_TYPE_DIB = 7;
/** /**
@ -58,14 +58,14 @@ public interface Workbook extends Closeable, Iterable<Sheet> {
* *
* @see #setSheetHidden(int, int) * @see #setSheetHidden(int, int)
*/ */
public static final int SHEET_STATE_VISIBLE = 0; int SHEET_STATE_VISIBLE = 0;
/** /**
* Indicates the book window is hidden, but can be shown by the user via the user interface. * Indicates the book window is hidden, but can be shown by the user via the user interface.
* *
* @see #setSheetHidden(int, int) * @see #setSheetHidden(int, int)
*/ */
public static final int SHEET_STATE_HIDDEN = 1; int SHEET_STATE_HIDDEN = 1;
/** /**
* Indicates the sheet is hidden and cannot be shown in the user interface (UI). * Indicates the sheet is hidden and cannot be shown in the user interface (UI).
@ -77,7 +77,7 @@ public interface Workbook extends Closeable, Iterable<Sheet> {
* *
* @see #setSheetHidden(int, int) * @see #setSheetHidden(int, int)
*/ */
public static final int SHEET_STATE_VERY_HIDDEN = 2; int SHEET_STATE_VERY_HIDDEN = 2;
/** /**
* Convenience method to get the active sheet. The active sheet is is the sheet * Convenience method to get the active sheet. The active sheet is is the sheet
@ -169,7 +169,7 @@ public interface Workbook extends Closeable, Iterable<Sheet> {
int getSheetIndex(Sheet sheet); int getSheetIndex(Sheet sheet);
/** /**
* Sreate an Sheet for this Workbook, adds it to the sheets and returns * Create a Sheet for this Workbook, adds it to the sheets and returns
* the high level representation. Use this to create new sheets. * the high level representation. Use this to create new sheets.
* *
* @return Sheet representing the new sheet. * @return Sheet representing the new sheet.
@ -217,7 +217,7 @@ public interface Workbook extends Closeable, Iterable<Sheet> {
* See {@link org.apache.poi.ss.util.WorkbookUtil#createSafeSheetName(String nameProposal)} * See {@link org.apache.poi.ss.util.WorkbookUtil#createSafeSheetName(String nameProposal)}
* for a safe way to create valid names * for a safe way to create valid names
* </p> * </p>
* @param sheetname sheetname to set for the sheet. * @param sheetname The name to set for the sheet.
* @return Sheet representing the new sheet. * @return Sheet representing the new sheet.
* @throws IllegalArgumentException if the name is null or invalid * @throws IllegalArgumentException if the name is null or invalid
* or workbook already contains a sheet with this name * or workbook already contains a sheet with this name
@ -617,7 +617,7 @@ public interface Workbook extends Closeable, Iterable<Sheet> {
* workbook values when the workbook is opened * workbook values when the workbook is opened
* @since 3.8 * @since 3.8
*/ */
public void setForceFormulaRecalculation(boolean value); void setForceFormulaRecalculation(boolean value);
/** /**
* Whether Excel will be asked to recalculate all formulas when the workbook is opened. * Whether Excel will be asked to recalculate all formulas when the workbook is opened.
@ -632,6 +632,5 @@ public interface Workbook extends Closeable, Iterable<Sheet> {
* @return SpreadsheetVersion enum * @return SpreadsheetVersion enum
* @since 3.14 beta 2 * @since 3.14 beta 2
*/ */
public SpreadsheetVersion getSpreadsheetVersion(); SpreadsheetVersion getSpreadsheetVersion();
} }

View File

@ -33,7 +33,6 @@ import org.apache.poi.hsmf.datatypes.AttachmentChunks;
import org.apache.poi.hsmf.extractor.OutlookTextExtactor; import org.apache.poi.hsmf.extractor.OutlookTextExtactor;
import org.apache.poi.hssf.extractor.ExcelExtractor; import org.apache.poi.hssf.extractor.ExcelExtractor;
import org.apache.poi.hwpf.extractor.WordExtractor; import org.apache.poi.hwpf.extractor.WordExtractor;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException; import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackageAccess; import org.apache.poi.openxml4j.opc.PackageAccess;
@ -123,7 +122,7 @@ public class ExtractorFactory {
return OLE2ExtractorFactory.getPreferEventExtractor(); return OLE2ExtractorFactory.getPreferEventExtractor();
} }
public static POITextExtractor createExtractor(File f) throws IOException, InvalidFormatException, OpenXML4JException, XmlException { public static POITextExtractor createExtractor(File f) throws IOException, OpenXML4JException, XmlException {
NPOIFSFileSystem fs = null; NPOIFSFileSystem fs = null;
try { try {
fs = new NPOIFSFileSystem(f); fs = new NPOIFSFileSystem(f);
@ -163,7 +162,7 @@ public class ExtractorFactory {
} }
} }
public static POITextExtractor createExtractor(InputStream inp) throws IOException, InvalidFormatException, OpenXML4JException, XmlException { public static POITextExtractor createExtractor(InputStream inp) throws IOException, OpenXML4JException, XmlException {
// Figure out the kind of stream // Figure out the kind of stream
// If clearly doesn't do mark/reset, wrap up // If clearly doesn't do mark/reset, wrap up
if (! inp.markSupported()) { if (! inp.markSupported()) {

View File

@ -64,7 +64,7 @@ public class SignatureConfig {
private static final POILogger LOG = POILogFactory.getLogger(SignatureConfig.class); private static final POILogger LOG = POILogFactory.getLogger(SignatureConfig.class);
public static interface SignatureConfigurable { public interface SignatureConfigurable {
void setSignatureConfig(SignatureConfig signatureConfig); void setSignatureConfig(SignatureConfig signatureConfig);
} }

View File

@ -134,7 +134,7 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> {
if (this instanceof PlaceableShape) { if (this instanceof PlaceableShape) {
PlaceableShape<?,?> ps = (PlaceableShape<?,?>)this; PlaceableShape<?,?> ps = (PlaceableShape<?,?>)this;
ps.setAnchor(((PlaceableShape<?,?>)sh).getAnchor()); ps.setAnchor(sh.getAnchor());
} }
@ -257,7 +257,7 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> {
* Different types of placeholders are allowed and can be specified by using the placeholder * Different types of placeholders are allowed and can be specified by using the placeholder
* type attribute for this element * type attribute for this element
* *
* @param placeholder * @param placeholder The shape to use as placeholder or null if no placeholder should be set.
*/ */
protected void setPlaceholder(Placeholder placeholder) { protected void setPlaceholder(Placeholder placeholder) {
String xquery = "declare namespace p='"+PML_NS+"' .//*/p:nvPr"; String xquery = "declare namespace p='"+PML_NS+"' .//*/p:nvPr";
@ -494,7 +494,7 @@ public abstract class XSLFShape implements Shape<XSLFShape,XSLFTextParagraph> {
int idx = (int)fillRef.getIdx(); int idx = (int)fillRef.getIdx();
CTSchemeColor phClr = fillRef.getSchemeClr(); CTSchemeColor phClr = fillRef.getSchemeClr();
CTStyleMatrix matrix = theme.getXmlObject().getThemeElements().getFmtScheme(); CTStyleMatrix matrix = theme.getXmlObject().getThemeElements().getFmtScheme();
XmlObject styleLst = null; final XmlObject styleLst;
int childIdx; int childIdx;
if (idx >= 1 && idx <= 999) { if (idx >= 1 && idx <= 999) {
childIdx = idx-1; childIdx = idx-1;

View File

@ -55,6 +55,7 @@ import org.apache.poi.POIDataSamples;
import org.apache.poi.POITestCase; import org.apache.poi.POITestCase;
import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.OPCPackage;
import org.apache.poi.openxml4j.opc.PackageAccess; import org.apache.poi.openxml4j.opc.PackageAccess;
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
import org.apache.poi.poifs.crypt.dsig.DigestInfo; import org.apache.poi.poifs.crypt.dsig.DigestInfo;
import org.apache.poi.poifs.crypt.dsig.SignatureConfig; import org.apache.poi.poifs.crypt.dsig.SignatureConfig;
import org.apache.poi.poifs.crypt.dsig.SignatureInfo; import org.apache.poi.poifs.crypt.dsig.SignatureInfo;
@ -99,7 +100,7 @@ public class TestSignatureInfo {
public static void initBouncy() throws IOException { public static void initBouncy() throws IOException {
CryptoFunctions.registerBouncyCastle(); CryptoFunctions.registerBouncyCastle();
/*** TODO : set cal to now ... only set to fixed date for debugging ... */ // Set cal to now ... only set to fixed date for debugging ...
cal = LocaleUtil.getLocaleCalendar(LocaleUtil.TIMEZONE_UTC); cal = LocaleUtil.getLocaleCalendar(LocaleUtil.TIMEZONE_UTC);
assertNotNull(cal); assertNotNull(cal);
// cal.set(2014, 7, 6, 21, 42, 12); // cal.set(2014, 7, 6, 21, 42, 12);
@ -403,7 +404,9 @@ public class TestSignatureInfo {
// verify // verify
Iterator<SignaturePart> spIter = si.getSignatureParts().iterator(); Iterator<SignaturePart> spIter = si.getSignatureParts().iterator();
assertTrue(spIter.hasNext()); assertTrue("Had: " + si.getSignatureConfig().getOpcPackage().
getRelationshipsByType(PackageRelationshipTypes.DIGITAL_SIGNATURE_ORIGIN),
spIter.hasNext());
SignaturePart sp = spIter.next(); SignaturePart sp = spIter.next();
boolean valid = sp.validate(); boolean valid = sp.validate();
assertTrue(valid); assertTrue(valid);

View File

@ -31,7 +31,6 @@ import org.apache.poi.xssf.usermodel.XSSFFormulaEvaluator;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import junit.framework.AssertionFailedError; import junit.framework.AssertionFailedError;
import junit.framework.TestCase;
import org.junit.Test; import org.junit.Test;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;

View File

@ -1581,7 +1581,7 @@ public final class TestXSSFSheet extends BaseTestXSheet {
System.out.println("Array formulas currently unsupported"); System.out.println("Array formulas currently unsupported");
// FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula() // FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula()
/* /*
assertEquals("[Array Formula] N7 cell type", CellType.FORMULA, cell.getCellType()); assertEquals("[Array Formula] N7 cell type", CellType.FORMULA, cell.getCellTypeEnum());
assertEquals("[Array Formula] N7 cell formula", "{SUM(H7:J7*{1,2,3})}", cell.getCellFormula()); assertEquals("[Array Formula] N7 cell formula", "{SUM(H7:J7*{1,2,3})}", cell.getCellFormula());
*/ */
@ -1792,12 +1792,12 @@ public final class TestXSSFSheet extends BaseTestXSheet {
// System.out.println("Array formulas currently unsupported"); // System.out.println("Array formulas currently unsupported");
/* /*
// FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula() // FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula()
assertEquals("[Array Formula] N10 cell type", CellType.FORMULA, cell.getCellType()); assertEquals("[Array Formula] N10 cell type", CellType.FORMULA, cell.getCellTypeEnum());
assertEquals("[Array Formula] N10 cell formula", "{SUM(H10:J10*{1,2,3})}", cell.getCellFormula()); assertEquals("[Array Formula] N10 cell formula", "{SUM(H10:J10*{1,2,3})}", cell.getCellFormula());
cell = CellUtil.getCell(destRow2, col); cell = CellUtil.getCell(destRow2, col);
// FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula() // FIXME: Array Formula set with Sheet.setArrayFormula() instead of cell.setFormula()
assertEquals("[Array Formula] N11 cell type", CellType.FORMULA, cell.getCellType()); assertEquals("[Array Formula] N11 cell type", CellType.FORMULA, cell.getCellTypeEnum());
assertEquals("[Array Formula] N11 cell formula", "{SUM(H11:J11*{1,2,3})}", cell.getCellFormula()); assertEquals("[Array Formula] N11 cell formula", "{SUM(H11:J11*{1,2,3})}", cell.getCellFormula());
*/ */

View File

@ -137,6 +137,8 @@ public final class Attachment {
/** /**
* Returns the contents of the attachment. * Returns the contents of the attachment.
*
* @throws IllegalArgumentException if there is no AttachmentData available in this Attachment
*/ */
public byte[] getContents() { public byte[] getContents() {
TNEFAttribute contents = getAttribute(TNEFProperty.ID_ATTACHDATA); TNEFAttribute contents = getAttribute(TNEFProperty.ID_ATTACHDATA);

View File

@ -1885,12 +1885,12 @@ public final class TestBugs extends BaseTestBugzillaIssues {
// TODO - Fix these so they work... // TODO - Fix these so they work...
/*row = s.getRow(4); /*row = s.getRow(4);
assertEquals(CellType.FORMULA, row.getCell(1).getCellType()); assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
assertEquals("'[$http://gagravarr.org/FormulaRefs2.xls]Sheet1'!B2", row.getCell(1).getCellFormula()); assertEquals("'[$http://gagravarr.org/FormulaRefs2.xls]Sheet1'!B2", row.getCell(1).getCellFormula());
assertEquals(123.0, row.getCell(1).getNumericCellValue(), 0); assertEquals(123.0, row.getCell(1).getNumericCellValue(), 0);
row = s.getRow(5); row = s.getRow(5);
assertEquals(CellType.FORMULA, row.getCell(1).getCellType()); assertEquals(CellType.FORMULA, row.getCell(1).getCellTypeEnum());
assertEquals("'[$http://example.com/FormulaRefs.xls]Sheet1'!B1", row.getCell(1).getCellFormula()); assertEquals("'[$http://example.com/FormulaRefs.xls]Sheet1'!B1", row.getCell(1).getCellFormula());
assertEquals(234.0, row.getCell(1).getNumericCellValue(), 0);*/ assertEquals(234.0, row.getCell(1).getNumericCellValue(), 0);*/

View File

@ -84,7 +84,7 @@ public class TestIfError extends TestCase {
assertEquals("Checks that the cell is numeric", assertEquals("Checks that the cell is numeric",
CellType.STRING, evaluator.evaluate(cell2).getCellTypeEnum()); CellType.STRING, evaluator.evaluate(cell2).getCellTypeEnum());
assertEquals("Rounds -10 to a nearest multiple of -3 (-9)", assertEquals("Rounds -10 to a nearest multiple of -3 (-9)",
"Error in calculation", evaluator.evaluate(cell2).getStringValue()); "Error in calculation", evaluator.evaluate(cell2).getStringValue());

View File

@ -33,12 +33,9 @@ import java.awt.font.FontRenderContext;
import java.awt.font.TextAttribute; import java.awt.font.TextAttribute;
import java.awt.font.TextLayout; import java.awt.font.TextLayout;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
import java.text.AttributedString; import java.text.AttributedString;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import static org.junit.Assert.*; import static org.junit.Assert.*;

View File

@ -570,7 +570,7 @@ public abstract class BaseTestSheetUpdateArrayFormulas {
assertEquals(cra.formatAsString(), mcell.getArrayFormulaRange().formatAsString()); assertEquals(cra.formatAsString(), mcell.getArrayFormulaRange().formatAsString());
assertEquals("A2:A4*B2:B4", mcell.getCellFormula()); assertEquals("A2:A4*B2:B4", mcell.getCellFormula());
assertTrue(mcell.isPartOfArrayFormulaGroup()); assertTrue(mcell.isPartOfArrayFormulaGroup());
assertEquals(CellType.FORMULA, mcell.getCellType()); assertEquals(CellType.FORMULA, mcell.getCellTypeEnum());
} }
*/ */