You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by ki...@apache.org on 2021/05/21 21:22:41 UTC
svn commit: r1890089 [2/6] - in /poi/trunk: ./ poi-examples/
poi-examples/src/main/java/org/apache/poi/examples/hpsf/
poi-examples/src/main/java/org/apache/poi/examples/xssf/eventusermodel/
poi-examples/src/main/java/org/apache/poi/examples/xssf/stream...
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java Fri May 21 21:22:40 2021
@@ -49,10 +49,9 @@ import org.apache.poi.ss.util.CellRefere
import org.apache.poi.util.Beta;
import org.apache.poi.util.Internal;
import org.apache.poi.util.LocaleUtil;
-import org.apache.poi.util.Removal;
+import org.apache.poi.xssf.model.CalculationChain;
import org.apache.poi.xssf.model.SharedStringsTable;
import org.apache.poi.xssf.model.StylesTable;
-import org.apache.poi.xssf.model.CalculationChain;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCell;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTCellFormula;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STCellFormulaType;
@@ -99,12 +98,12 @@ public final class XSSFCell extends Cell
* Table of strings shared across this workbook.
* If two cells contain the same string, then the cell value is the same index into SharedStringsTable
*/
- private SharedStringsTable _sharedStringSource;
+ private final SharedStringsTable _sharedStringSource;
/**
* Table of cell styles shared across all cells in a workbook.
*/
- private StylesTable _stylesSource;
+ private final StylesTable _stylesSource;
/**
* Construct a XSSFCell.
@@ -127,9 +126,6 @@ public final class XSSFCell extends Cell
_stylesSource = row.getSheet().getWorkbook().getStylesSource();
}
- /**
- * {@inheritDoc}
- */
@Override
protected SpreadsheetVersion getSpreadsheetVersion() {
return SpreadsheetVersion.EXCEL2007;
@@ -290,7 +286,7 @@ public final class XSSFCell extends Cell
* </p>
* @return the value of the cell as a number
* @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
- * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
+ * @exception NumberFormatException if the cell value isn't a parsable {@code double}.
* @see DataFormatter for turning this number into a string similar to that which Excel would render this number as.
*/
@Override
@@ -320,9 +316,6 @@ public final class XSSFCell extends Cell
}
}
- /**
- * {@inheritDoc}
- */
@Override
public void setCellValueImpl(double value) {
_cell.setT(STCellType.N);
@@ -385,10 +378,14 @@ public final class XSSFCell extends Cell
}
}
break;
- case FORMULA:
- checkFormulaCachedValueType(CellType.STRING, getBaseCellType(false));
+ case FORMULA: {
+ CellType cachedValueType = getBaseCellType(false);
+ if (cachedValueType != CellType.STRING) {
+ throw typeMismatch(CellType.STRING, cachedValueType, true);
+ }
rt = new XSSFRichTextString(_cell.isSetV() ? _cell.getV() : "");
break;
+ }
default:
throw typeMismatch(CellType.STRING, cellType, false);
}
@@ -396,23 +393,11 @@ public final class XSSFCell extends Cell
return rt;
}
- private static void checkFormulaCachedValueType(CellType expectedTypeCode, CellType cachedValueType) {
- if (cachedValueType != expectedTypeCode) {
- throw typeMismatch(expectedTypeCode, cachedValueType, true);
- }
- }
-
- /**
- * {@inheritDoc}
- */
@Override
protected void setCellValueImpl(String value) {
setCellValueImpl(new XSSFRichTextString(value));
}
- /**
- * {@inheritDoc}
- */
@Override
protected void setCellValueImpl(RichTextString str) {
CellType cellType = getCellType();
@@ -434,7 +419,7 @@ public final class XSSFCell extends Cell
}
/**
- * Return a formula for the cell, for example, <code>SUM(C4:E4)</code>
+ * Return a formula for the cell, for example, {@code SUM(C4:E4)}
*
* @return a formula for the cell
* @throws IllegalStateException if the cell type returned by {@link #getCellType()} is not {@link CellType#FORMULA}
@@ -517,8 +502,8 @@ public final class XSSFCell extends Cell
* {@link FormulaEvaluator} instances based on this workbook.
* </p>
*
- * @param formula the formula to set, e.g. <code>"SUM(C4:E4)"</code>.
- * If the argument is <code>null</code> then the current formula is removed.
+ * @param formula the formula to set, e.g. {@code "SUM(C4:E4)"}.
+ * If the argument is {@code null} then the current formula is removed.
* @throws org.apache.poi.ss.formula.FormulaParseException if the formula has incorrect syntax or is otherwise invalid
* @throws IllegalStateException if the operation is not allowed, for example,
* when the cell is a part of a multi-cell array formula
@@ -657,10 +642,8 @@ public final class XSSFCell extends Cell
* @return true if the cell is of a formula type POI can handle
*/
private boolean isFormulaCell() {
- if ( (_cell.isSetF() && _cell.getF().getT() != STCellFormulaType.DATA_TABLE ) || getSheet().isCellInArrayFormulaContext(this)) {
- return true;
- }
- return false;
+ return (_cell.isSetF() && _cell.getF().getT() != STCellFormulaType.DATA_TABLE)
+ || getSheet().isCellInArrayFormulaContext(this);
}
/**
@@ -732,7 +715,7 @@ public final class XSSFCell extends Cell
* </p>
* @return the value of the cell as a date
* @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
- * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
+ * @exception NumberFormatException if the cell value isn't a parsable {@code double}.
* @see DataFormatter for formatting this date into a string similar to how excel does.
*/
@Override
@@ -753,7 +736,7 @@ public final class XSSFCell extends Cell
* </p>
* @return the value of the cell as a LocalDateTime
* @throws IllegalStateException if the cell type returned by {@link #getCellType()} is {@link CellType#STRING}
- * @exception NumberFormatException if the cell value isn't a parsable <code>double</code>.
+ * @exception NumberFormatException if the cell value isn't a parsable {@code double}.
* @see DataFormatter for formatting this date into a string similar to how excel does.
*/
@Override
@@ -767,27 +750,18 @@ public final class XSSFCell extends Cell
return DateUtil.getLocalDateTime(value, date1904);
}
- /**
- * {@inheritDoc}
- */
@Override
protected void setCellValueImpl(Date value) {
boolean date1904 = getSheet().getWorkbook().isDate1904();
setCellValue(DateUtil.getExcelDate(value, date1904));
}
- /**
- * {@inheritDoc}
- */
@Override
protected void setCellValueImpl(LocalDateTime value) {
boolean date1904 = getSheet().getWorkbook().isDate1904();
setCellValue(DateUtil.getExcelDate(value, date1904));
}
- /**
- * {@inheritDoc}
- */
@Override
protected void setCellValueImpl(Calendar value) {
boolean date1904 = getSheet().getWorkbook().isDate1904();
@@ -861,9 +835,6 @@ public final class XSSFCell extends Cell
_cell.setV(error.getString());
}
- /**
- * {@inheritDoc}
- */
@Override
public void setAsActiveCell() {
getSheet().setActiveCell(getAddress());
@@ -902,7 +873,6 @@ public final class XSSFCell extends Cell
/**
* Needed by bug #62834, which points out getCellFormula() expects an evaluation context or creates a new one,
* so if there is one in use, it needs to be carried on through.
- * @param cellType
* @param evalWb BaseXSSFEvaluationWorkbook already in use, or null if a new implicit one should be used
*/
protected void setCellType(CellType cellType, BaseXSSFEvaluationWorkbook evalWb) {
@@ -1003,7 +973,7 @@ public final class XSSFCell extends Cell
* </p>
*
* @return the raw cell value as contained in the underlying CTCell bean,
- * <code>null</code> for blank cells.
+ * {@code null} for blank cells.
*/
public String getRawValue() {
return _cell.getV();
@@ -1034,7 +1004,7 @@ public final class XSSFCell extends Cell
/**
* Returns cell comment associated with this cell
*
- * @return the cell comment associated with this cell or <code>null</code>
+ * @return the cell comment associated with this cell or {@code null}
*/
@Override
public XSSFComment getCellComment() {
@@ -1074,7 +1044,7 @@ public final class XSSFCell extends Cell
/**
* Returns hyperlink associated with this cell
*
- * @return hyperlink associated with this cell or <code>null</code> if not found
+ * @return hyperlink associated with this cell or {@code null} if not found
*/
@Override
public XSSFHyperlink getHyperlink() {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChart.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChart.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChart.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChart.java Fri May 21 21:22:40 2021
@@ -17,25 +17,31 @@
package org.apache.poi.xssf.usermodel;
+import static org.apache.poi.ooxml.POIXMLTypeLoader.DEFAULT_XML_OPTIONS;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.xml.namespace.QName;
+
import org.apache.poi.ooxml.POIXMLFactory;
import org.apache.poi.ooxml.POIXMLRelation;
import org.apache.poi.openxml4j.opc.PackagePart;
-import org.apache.poi.util.Removal;
import org.apache.poi.xddf.usermodel.chart.XDDFChart;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.apache.xmlbeans.XmlOptions;
-import org.openxmlformats.schemas.drawingml.x2006.chart.*;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTChartSpace;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTPageMargins;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTPrintSettings;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTStrRef;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTTitle;
+import org.openxmlformats.schemas.drawingml.x2006.chart.CTTx;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
-import javax.xml.namespace.QName;
-import java.io.IOException;
-import java.io.OutputStream;
-
-import static org.apache.poi.ooxml.POIXMLTypeLoader.DEFAULT_XML_OPTIONS;
-
/**
* Represents a SpreadsheetML Chart
*/
@@ -60,7 +66,7 @@ public final class XSSFChart extends XDD
* @param part
* the package part holding the chart data, the content type must
* be
- * <code>application/vnd.openxmlformats-officedocument.drawingml.chart+xml</code>
+ * {@code application/vnd.openxmlformats-officedocument.drawingml.chart+xml}
*
* @since POI 3.14-Beta1
*/
@@ -204,8 +210,6 @@ public final class XSSFChart extends XDD
/**
* Set the formula expression to use for the chart title
- *
- * @param formula
*/
public void setTitleFormula(String formula) {
CTTitle ctTitle;
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFClientAnchor.java Fri May 21 21:22:40 2021
@@ -191,8 +191,6 @@ public class XSSFClientAnchor extends XS
}
/**
- * @param sheet
- * @param row
* @return height in twips (1/20th of point) for row or default
*/
private static float getRowHeight(XSSFSheet sheet, int row) {
@@ -208,54 +206,59 @@ public class XSSFClientAnchor extends XS
return cell2 != null ? cell2 : calcCell(getCell1(), size.getCx(), size.getCy());
}
+ @Override
public short getCol1() {
return (short)getCell1().getCol();
}
/**
* @throws NullPointerException if cell1 is null (fixed position)
- * @see org.apache.poi.ss.usermodel.ClientAnchor#setCol1(int)
*/
+ @Override
public void setCol1(int col1) {
cell1.setCol(col1);
}
+ @Override
public short getCol2() {
return (short) getCell2().getCol();
}
/**
* @throws NullPointerException if cell2 is null (fixed size)
- * @see org.apache.poi.ss.usermodel.ClientAnchor#setCol2(int)
*/
+ @Override
public void setCol2(int col2) {
cell2.setCol(col2);
}
+ @Override
public int getRow1() {
return getCell1().getRow();
}
/**
* @throws NullPointerException if cell1 is null (fixed position)
- * @see org.apache.poi.ss.usermodel.ClientAnchor#setRow1(int)
*/
+ @Override
public void setRow1(int row1) {
cell1.setRow(row1);
}
+ @Override
public int getRow2() {
return getCell2().getRow();
}
/**
* @throws NullPointerException if cell2 is null (fixed size)
- * @see org.apache.poi.ss.usermodel.ClientAnchor#setRow2(int)
*/
+ @Override
public void setRow2(int row2) {
cell2.setRow(row2);
}
+ @Override
public int getDx1() {
return Math.toIntExact(POIXMLUnits.parseLength(getCell1().xgetColOff()));
}
@@ -264,10 +267,12 @@ public class XSSFClientAnchor extends XS
* @throws NullPointerException if cell1 is null (fixed position)
* @see org.apache.poi.ss.usermodel.ChildAnchor#setDx1(int)
*/
+ @Override
public void setDx1(int dx1) {
cell1.setColOff(dx1);
}
+ @Override
public int getDy1() {
return Math.toIntExact(POIXMLUnits.parseLength(getCell1().xgetRowOff()));
}
@@ -276,10 +281,12 @@ public class XSSFClientAnchor extends XS
* @throws NullPointerException if cell1 is null (fixed position)
* @see org.apache.poi.ss.usermodel.ChildAnchor#setDy1(int)
*/
+ @Override
public void setDy1(int dy1) {
cell1.setRowOff(dy1);
}
+ @Override
public int getDy2() {
return Math.toIntExact(POIXMLUnits.parseLength(getCell2().xgetRowOff()));
}
@@ -288,10 +295,12 @@ public class XSSFClientAnchor extends XS
* @throws NullPointerException if cell2 is null (fixed size)
* @see org.apache.poi.ss.usermodel.ChildAnchor#setDy2(int)
*/
+ @Override
public void setDy2(int dy2) {
cell2.setRowOff(dy2);
}
+ @Override
public int getDx2() {
return Math.toIntExact(POIXMLUnits.parseLength(getCell2().xgetColOff()));
}
@@ -300,13 +309,14 @@ public class XSSFClientAnchor extends XS
* @throws NullPointerException if cell2 is null (fixed size)
* @see org.apache.poi.ss.usermodel.ChildAnchor#setDx2(int)
*/
+ @Override
public void setDx2(int dx2) {
cell2.setColOff(dx2);
}
@Override
public boolean equals(Object o) {
- if (o == null || !(o instanceof XSSFClientAnchor)) return false;
+ if (!(o instanceof XSSFClientAnchor)) return false;
XSSFClientAnchor anchor = (XSSFClientAnchor) o;
return getDx1() == anchor.getDx1() &&
@@ -369,7 +379,6 @@ public class XSSFClientAnchor extends XS
/**
* Sets the top-left absolute position of the object. To use this, "from" must be set to null.
- * @param position
* @since POI 3.17 beta 1
*/
public void setPosition(CTPoint2D position) {
@@ -387,7 +396,6 @@ public class XSSFClientAnchor extends XS
/**
* Sets the size of the object. To use this, "to" must be set to null.
- * @param size
* @since POI 3.17 beta 1
*/
public void setSize(CTPositiveSize2D size) {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormattingRule.java Fri May 21 21:22:40 2021
@@ -51,10 +51,10 @@ import org.openxmlformats.schemas.spread
*/
public class XSSFConditionalFormattingRule implements ConditionalFormattingRule {
private final CTCfRule _cfRule;
- private XSSFSheet _sh;
+ private final XSSFSheet _sh;
- private static Map<STCfType.Enum, ConditionType> typeLookup = new HashMap<>();
- private static Map<STCfType.Enum, ConditionFilterType> filterTypeLookup = new HashMap<>();
+ private static final Map<STCfType.Enum, ConditionType> typeLookup = new HashMap<>();
+ private static final Map<STCfType.Enum, ConditionFilterType> filterTypeLookup = new HashMap<>();
static {
typeLookup.put(STCfType.CELL_IS, ConditionType.CELL_VALUE_IS);
typeLookup.put(STCfType.EXPRESSION, ConditionType.FORMULA);
@@ -95,7 +95,6 @@ public class XSSFConditionalFormattingRu
/**
* NOTE: does not set priority, so this assumes the rule will not be added to the sheet yet
- * @param sh
*/
/*package*/ XSSFConditionalFormattingRule(XSSFSheet sh){
_cfRule = CTCfRule.Factory.newInstance();
@@ -126,12 +125,14 @@ public class XSSFConditionalFormattingRu
return dxf;
}
+ @Override
public int getPriority() {
final int priority = _cfRule.getPriority();
// priorities start at 1, if it is less, it is undefined, use definition order in caller
return priority >=1 ? priority : 0;
}
+ @Override
public boolean getStopIfTrue() {
return _cfRule.getStopIfTrue();
}
@@ -140,8 +141,9 @@ public class XSSFConditionalFormattingRu
* Create a new border formatting structure if it does not exist,
* otherwise just return existing object.
*
- * @return - border formatting object, never returns <code>null</code>.
+ * @return - border formatting object, never returns {@code null}.
*/
+ @Override
public XSSFBorderFormatting createBorderFormatting(){
CTDxf dxf = getDxf(true);
CTBorder border;
@@ -155,8 +157,9 @@ public class XSSFConditionalFormattingRu
}
/**
- * @return - border formatting object if defined, <code>null</code> otherwise
+ * @return - border formatting object if defined, {@code null} otherwise
*/
+ @Override
public XSSFBorderFormatting getBorderFormatting(){
CTDxf dxf = getDxf(false);
if(dxf == null || !dxf.isSetBorder()) return null;
@@ -168,8 +171,9 @@ public class XSSFConditionalFormattingRu
* Create a new font formatting structure if it does not exist,
* otherwise just return existing object.
*
- * @return - font formatting object, never returns <code>null</code>.
+ * @return - font formatting object, never returns {@code null}.
*/
+ @Override
public XSSFFontFormatting createFontFormatting(){
CTDxf dxf = getDxf(true);
CTFont font;
@@ -183,8 +187,9 @@ public class XSSFConditionalFormattingRu
}
/**
- * @return - font formatting object if defined, <code>null</code> otherwise
+ * @return - font formatting object if defined, {@code null} otherwise
*/
+ @Override
public XSSFFontFormatting getFontFormatting(){
CTDxf dxf = getDxf(false);
if(dxf == null || !dxf.isSetFont()) return null;
@@ -196,8 +201,9 @@ public class XSSFConditionalFormattingRu
* Create a new pattern formatting structure if it does not exist,
* otherwise just return existing object.
*
- * @return - pattern formatting object, never returns <code>null</code>.
+ * @return - pattern formatting object, never returns {@code null}.
*/
+ @Override
public XSSFPatternFormatting createPatternFormatting(){
CTDxf dxf = getDxf(true);
CTFill fill;
@@ -211,8 +217,9 @@ public class XSSFConditionalFormattingRu
}
/**
- * @return - pattern formatting object if defined, <code>null</code> otherwise
+ * @return - pattern formatting object if defined, {@code null} otherwise
*/
+ @Override
public XSSFPatternFormatting getPatternFormatting(){
CTDxf dxf = getDxf(false);
if(dxf == null || !dxf.isSetFill()) return null;
@@ -221,8 +228,6 @@ public class XSSFConditionalFormattingRu
}
/**
- *
- * @param color
* @return data bar formatting
*/
public XSSFDataBarFormatting createDataBarFormatting(XSSFColor color) {
@@ -234,12 +239,7 @@ public class XSSFConditionalFormattingRu
_cfRule.setType(STCfType.DATA_BAR);
// Ensure the right element
- CTDataBar bar = null;
- if (_cfRule.isSetDataBar()) {
- bar = _cfRule.getDataBar();
- } else {
- bar = _cfRule.addNewDataBar();
- }
+ CTDataBar bar = _cfRule.isSetDataBar() ? _cfRule.getDataBar() : _cfRule.addNewDataBar();
// Set the color
bar.setColor(color.getCTColor());
@@ -252,6 +252,7 @@ public class XSSFConditionalFormattingRu
// Wrap and return
return new XSSFDataBarFormatting(bar, _sh.getWorkbook().getStylesSource().getIndexedColors());
}
+ @Override
public XSSFDataBarFormatting getDataBarFormatting() {
if (_cfRule.isSetDataBar()) {
CTDataBar bar = _cfRule.getDataBar();
@@ -270,12 +271,7 @@ public class XSSFConditionalFormattingRu
_cfRule.setType(STCfType.ICON_SET);
// Ensure the right element
- CTIconSet icons = null;
- if (_cfRule.isSetIconSet()) {
- icons = _cfRule.getIconSet();
- } else {
- icons = _cfRule.addNewIconSet();
- }
+ CTIconSet icons = _cfRule.isSetIconSet() ? _cfRule.getIconSet() : _cfRule.addNewIconSet();
// Set the type of the icon set
if (iconSet.name != null) {
STIconSetType.Enum xIconSet = STIconSetType.Enum.forString(iconSet.name);
@@ -294,6 +290,7 @@ public class XSSFConditionalFormattingRu
// Wrap and return
return new XSSFIconMultiStateFormatting(icons);
}
+ @Override
public XSSFIconMultiStateFormatting getMultiStateFormatting() {
if (_cfRule.isSetIconSet()) {
CTIconSet icons = _cfRule.getIconSet();
@@ -312,12 +309,7 @@ public class XSSFConditionalFormattingRu
_cfRule.setType(STCfType.COLOR_SCALE);
// Ensure the right element
- CTColorScale scale = null;
- if (_cfRule.isSetColorScale()) {
- scale = _cfRule.getColorScale();
- } else {
- scale = _cfRule.addNewColorScale();
- }
+ CTColorScale scale = _cfRule.isSetColorScale() ? _cfRule.getColorScale() : _cfRule.addNewColorScale();
// Add a default set of thresholds and colors
if (scale.sizeOfCfvoArray() == 0) {
@@ -338,6 +330,7 @@ public class XSSFConditionalFormattingRu
// Wrap and return
return new XSSFColorScaleFormatting(scale, _sh.getWorkbook().getStylesSource().getIndexedColors());
}
+ @Override
public XSSFColorScaleFormatting getColorScaleFormatting() {
if (_cfRule.isSetColorScale()) {
CTColorScale scale = _cfRule.getColorScale();
@@ -349,8 +342,8 @@ public class XSSFConditionalFormattingRu
/**
* Return the number format from the dxf style record if present, null if not
- * @see org.apache.poi.ss.usermodel.ConditionalFormattingRule#getNumberFormat()
*/
+ @Override
public ExcelNumberFormat getNumberFormat() {
CTDxf dxf = getDxf(false);
if(dxf == null || !dxf.isSetNumFmt()) return null;
@@ -369,12 +362,13 @@ public class XSSFConditionalFormattingRu
/**
* Will return null if {@link #getConditionType()} != {@link ConditionType#FILTER}
- * @see org.apache.poi.ss.usermodel.ConditionalFormattingRule#getConditionFilterType()
*/
+ @Override
public ConditionFilterType getConditionFilterType() {
return filterTypeLookup.get(_cfRule.getType());
}
+ @Override
public ConditionFilterData getFilterConfiguration() {
return new XSSFConditionFilterData(_cfRule);
}
@@ -384,7 +378,6 @@ public class XSSFConditionalFormattingRu
* {@link ConditionType#CELL_VALUE_IS}
* <p>
* MUST be a constant from {@link org.apache.poi.ss.usermodel.ComparisonOperator}
- * </p>
*
* @return the conditional format operator
*/
@@ -413,13 +406,12 @@ public class XSSFConditionalFormattingRu
* this field is the first operand of the comparison.
* If type is {@link ConditionType#FORMULA}, this formula is used
* to determine if the conditional formatting is applied.
- * </p>
* <p>
* If comparison type is {@link ConditionType#FORMULA} the formula MUST be a Boolean function
- * </p>
*
* @return the first formula
*/
+ @Override
public String getFormula1(){
return _cfRule.sizeOfFormulaArray() > 0 ? _cfRule.getFormulaArray(0) : null;
}
@@ -431,10 +423,12 @@ public class XSSFConditionalFormattingRu
*
* @return the second formula
*/
+ @Override
public String getFormula2(){
return _cfRule.sizeOfFormulaArray() == 2 ? _cfRule.getFormulaArray(1) : null;
}
+ @Override
public String getText() {
return _cfRule.getText();
}
@@ -443,6 +437,7 @@ public class XSSFConditionalFormattingRu
* Conditional format rules don't define stripes, so always 0
* @see org.apache.poi.ss.usermodel.DifferentialStyleProvider#getStripeSize()
*/
+ @Override
public int getStripeSize() {
return 0;
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConnector.java Fri May 21 21:22:40 2021
@@ -42,7 +42,7 @@ public final class XSSFConnector extends
private static CTConnector prototype;
- private CTConnector ctShape;
+ private final CTConnector ctShape;
/**
* Construct a new XSSFConnector object.
@@ -128,6 +128,7 @@ public final class XSSFConnector extends
ctShape.getSpPr().getPrstGeom().setPrst(STShapeType.Enum.forInt(type));
}
+ @Override
protected CTShapeProperties getShapeProperties(){
return ctShape.getSpPr();
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationConstraint.java Fri May 21 21:22:40 2021
@@ -36,7 +36,7 @@ public class XSSFDataValidationConstrain
private String formula1;
private String formula2;
- private int validationType = -1;
+ private final int validationType;
private int operator = -1;
private String[] explicitListOfValues;
@@ -73,10 +73,8 @@ public class XSSFDataValidationConstrain
/**
* This is the constructor called using the OOXML raw data. Excel overloads formula1 to also encode explicit value lists,
* so this constructor has to check for and parse that syntax.
- * @param validationType
- * @param operator
* @param formula1 Overloaded: formula1 or list of explicit values
- * @param formula2 (formula1 is a list of explicit values, this is ignored: use <code>null</code>)
+ * @param formula2 (formula1 is a list of explicit values, this is ignored: use {@code null})
*/
public XSSFDataValidationConstraint(int validationType, int operator, String formula1, String formula2) {
super();
@@ -101,6 +99,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#getExplicitListValues()
*/
+ @Override
public String[] getExplicitListValues() {
return explicitListOfValues;
}
@@ -108,6 +107,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#getFormula1()
*/
+ @Override
public String getFormula1() {
return formula1;
}
@@ -115,6 +115,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#getFormula2()
*/
+ @Override
public String getFormula2() {
return formula2;
}
@@ -122,6 +123,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#getOperator()
*/
+ @Override
public int getOperator() {
return operator;
}
@@ -129,6 +131,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#getValidationType()
*/
+ @Override
public int getValidationType() {
return validationType;
}
@@ -136,6 +139,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#setExplicitListValues(java.lang.String[])
*/
+ @Override
public void setExplicitListValues(String[] explicitListValues) {
this.explicitListOfValues = explicitListValues;
@@ -143,8 +147,7 @@ public class XSSFDataValidationConstrain
// further, Excel has no escaping for commas in explicit lists, so we don't need to worry about that.
if ( explicitListOfValues!=null && explicitListOfValues.length > 0 ) {
StringBuilder builder = new StringBuilder(QUOTE);
- for (int i = 0; i < explicitListValues.length; i++) {
- String string = explicitListValues[i];
+ for (String string : explicitListValues) {
if (builder.length() > 1) {
builder.append(LIST_SEPARATOR);
}
@@ -158,6 +161,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#setFormula1(java.lang.String)
*/
+ @Override
public void setFormula1(String formula1) {
this.formula1 = removeLeadingEquals(formula1);
}
@@ -182,6 +186,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#setFormula2(java.lang.String)
*/
+ @Override
public void setFormula2(String formula2) {
this.formula2 = removeLeadingEquals(formula2);
}
@@ -189,6 +194,7 @@ public class XSSFDataValidationConstrain
/* (non-Javadoc)
* @see org.apache.poi.ss.usermodel.DataValidationConstraint#setOperator(int)
*/
+ @Override
public void setOperator(int operator) {
this.operator = operator;
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDxfStyleProvider.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDxfStyleProvider.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDxfStyleProvider.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDxfStyleProvider.java Fri May 21 21:22:40 2021
@@ -38,9 +38,7 @@ public class XSSFDxfStyleProvider implem
private final int stripeSize;
/**
- * @param dxf
* @param stripeSize 0 for non-stripe styles, > 1 for stripes
- * @param colorMap
*/
public XSSFDxfStyleProvider(CTDxf dxf, int stripeSize, IndexedColorMap colorMap) {
this.stripeSize = stripeSize;
@@ -63,22 +61,27 @@ public class XSSFDxfStyleProvider implem
}
}
+ @Override
public BorderFormatting getBorderFormatting() {
return border;
}
+ @Override
public FontFormatting getFontFormatting() {
return font;
}
+ @Override
public ExcelNumberFormat getNumberFormat() {
return number;
}
+ @Override
public PatternFormatting getPatternFormatting() {
return fill;
}
+ @Override
public int getStripeSize() {
return stripeSize;
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvaluationSheet.java Fri May 21 21:22:40 2021
@@ -51,17 +51,18 @@ final class XSSFEvaluationSheet implemen
public int getLastRowNum() {
return _xs.getLastRowNum();
}
-
+
/* (non-Javadoc)
* @see org.apache.poi.ss.formula.EvaluationSheet#isRowHidden(int)
* @since POI 4.1.0
*/
+ @Override
public boolean isRowHidden(int rowIndex) {
final XSSFRow row = _xs.getRow(rowIndex);
if (row == null) return false;
return row.getZeroHeight();
}
-
+
/* (non-JavaDoc), inherit JavaDoc from EvaluationWorkbook
* @since POI 3.15 beta 3
*/
@@ -69,7 +70,7 @@ final class XSSFEvaluationSheet implemen
public void clearAllCachedResultValues() {
_cellCache = null;
}
-
+
@Override
public EvaluationCell getCell(int rowIndex, int columnIndex) {
// shortcut evaluation if reference is outside the bounds of existing data
@@ -91,10 +92,10 @@ final class XSSFEvaluationSheet implemen
}
}
}
-
+
final CellKey key = new CellKey(rowIndex, columnIndex);
EvaluationCell evalcell = _cellCache.get(key);
-
+
// If cache is stale, update cache with this one cell
// This is a compromise between rebuilding the entire cache
// (which would quickly defeat the benefit of the cache)
@@ -115,17 +116,17 @@ final class XSSFEvaluationSheet implemen
return evalcell;
}
-
+
private static class CellKey {
private final int _row;
private final int _col;
private int _hash = -1; //lazily computed
-
+
protected CellKey(int row, int col) {
_row = row;
_col = col;
}
-
+
@Override
public int hashCode() {
if ( _hash == -1 ) {
@@ -133,7 +134,7 @@ final class XSSFEvaluationSheet implemen
}
return _hash;
}
-
+
@Override
public boolean equals(Object obj) {
if (!(obj instanceof CellKey)) {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenFooter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenFooter.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenFooter.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenFooter.java Fri May 21 21:22:40 2021
@@ -23,32 +23,31 @@ import org.openxmlformats.schemas.spread
/**
* <p>
- * Even page footer value. Corresponds to even printed pages.
- * Even page(s) in the sheet may not be printed, for example, if the print area is specified to be
- * a range such that it falls outside an even page's scope.
- * If no even footer is specified, then the odd footer's value is assumed for even page footers.
+ * Even page footer value. Corresponds to even printed pages.
+ * Even page(s) in the sheet may not be printed, for example, if the print area is specified to be
+ * a range such that it falls outside an even page's scope.
+ * If no even footer is specified, then the odd footer's value is assumed for even page footers.
* </p><p>
* The even footer is activated by the "Different Even/Odd" Header/Footer property for the sheet.
* If this property is not set, the even footer is ignored, and the odd footer is used instead.
* </p><p>
* Creating an even header or footer sets this property by default, so all you need to do to
* get an even header or footer to display is to create one. Likewise, if both the even header
- * and footer are usnset, then this property is unset, and the odd header and footer are used
+ * and footer are usnset, then this property is unset, and the odd header and footer are used
* for even pages.
* </p>
*/
public class XSSFEvenFooter extends XSSFHeaderFooter implements Footer{
-
+
/**
* Create an instance of XSSFEvenFooter from the supplied XML bean
* @see XSSFSheet#getEvenFooter()
- * @param headerFooter
*/
protected XSSFEvenFooter(CTHeaderFooter headerFooter) {
super(headerFooter);
headerFooter.setDifferentOddEven(true);
}
-
+
/**
* Get the content text representing the footer
* @return text
@@ -57,14 +56,14 @@ public class XSSFEvenFooter extends XSSF
public String getText() {
return getHeaderFooter().getEvenFooter();
}
-
+
/**
* Set a text for the footer. If null, unset the value. If unsetting and there is no
* Even Header for this sheet, the "DifferentEvenOdd" property for this sheet is
* unset.
- *
+ *
* @see XSSFHeaderFooter to see how to create a string with Header/Footer Formatting Syntax
- * @param text - a string representing the footer.
+ * @param text - a string representing the footer.
*/
@Override
public void setText(String text) {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenHeader.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenHeader.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenHeader.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFEvenHeader.java Fri May 21 21:22:40 2021
@@ -42,9 +42,8 @@ public class XSSFEvenHeader extends XSSF
/**
* Create an instance of XSSFEvenHeader from the supplied XML bean. If an even
* header is created, The property "DifferentOddEven" is set for this sheet as well.
- *
+ *
* @see XSSFSheet#getEvenHeader()
- * @param headerFooter
*/
protected XSSFEvenHeader(CTHeaderFooter headerFooter) {
super(headerFooter);
@@ -53,7 +52,7 @@ public class XSSFEvenHeader extends XSSF
/**
* Get the content text representing this header
- *
+ *
* @return text
*/
@Override
@@ -65,7 +64,7 @@ public class XSSFEvenHeader extends XSSF
* Set a text for the header. If null, unset the value. If unsetting and there is no
* Even Footer for this sheet, the "DifferentEvenOdd" property for this sheet is
* unset.
- *
+ *
* @see XSSFHeaderFooter to see how to create a string with Header/Footer
* Formatting Syntax
* @param text
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstFooter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstFooter.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstFooter.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstFooter.java Fri May 21 21:22:40 2021
@@ -23,8 +23,8 @@ import org.openxmlformats.schemas.spread
/**
* <p>
- * First page footer content. Corresponds to first printed page.
- * The first logical page in the sheet may not be printed, for example, if the print area is specified to
+ * First page footer content. Corresponds to first printed page.
+ * The first logical page in the sheet may not be printed, for example, if the print area is specified to
* be a range such that it falls outside the first page's scope.
* </p><p>
* The first page footer is activated by the "Different First" Header/Footer property for the sheet.
@@ -41,13 +41,12 @@ public class XSSFFirstFooter extends XSS
/**
* Create an instance of XSSFFirstFooter from the supplied XML bean
* @see XSSFSheet#getFirstFooter()
- * @param headerFooter
*/
protected XSSFFirstFooter(CTHeaderFooter headerFooter) {
super(headerFooter);
headerFooter.setDifferentFirst(true);
}
-
+
/**
* Get the content text representing the footer
* @return text
@@ -56,13 +55,13 @@ public class XSSFFirstFooter extends XSS
public String getText() {
return getHeaderFooter().getFirstFooter();
}
-
+
/**
- * Set a text for the footer. If null unset the value. If unsetting this header results
+ * Set a text for the footer. If null unset the value. If unsetting this header results
* in no First Header, or footer for the sheet, the 'differentFirst' property is unset as well.
- *
+ *
* @see XSSFHeaderFooter to see how to create a string with Header/Footer Formatting Syntax
- * @param text - a string representing the footer.
+ * @param text - a string representing the footer.
*/
@Override
public void setText(String text) {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstHeader.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstHeader.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstHeader.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFirstHeader.java Fri May 21 21:22:40 2021
@@ -22,32 +22,29 @@ import org.apache.poi.xssf.usermodel.ext
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTHeaderFooter;
/**
- * <p>
* First page header content. Corresponds to first printed page.
- * The first logical page in the sheet may not be printed, for example, if the print area is specified to
+ * The first logical page in the sheet may not be printed, for example, if the print area is specified to
* be a range such that it falls outside the first page's scope.
- * </p><p>
+ * <p>
* The first page header is activated by the "Different First" Header/Footer property for the sheet.
* If this property is not set, the first page header is ignored.
- * </p><p>
+ * <p>
* Creating a first page header or footer sets this property by default, so all you need to do to
* get an first page header or footer to display is to create one. Likewise, if both the first page
* header and footer are usnset, then this property is unset, and the first page header and footer
* are ignored.
- * </p>
*/
public class XSSFFirstHeader extends XSSFHeaderFooter implements Header{
/**
* Create an instance of XSSFFirstHeader from the supplied XML bean
* @see XSSFSheet#getFirstHeader()
- * @param headerFooter
*/
protected XSSFFirstHeader(CTHeaderFooter headerFooter) {
super(headerFooter);
headerFooter.setDifferentFirst(true);
}
-
+
/**
* Get the content text representing this header
* @return text
@@ -56,13 +53,13 @@ public class XSSFFirstHeader extends XSS
public String getText() {
return getHeaderFooter().getFirstHeader();
}
-
+
/**
- * Set a text for the header. If null unset the value. If unsetting this header results
+ * Set a text for the header. If null unset the value. If unsetting this header results
* in no First Header, or footer for the sheet, the 'differentFirst' property is unset as well.
- *
+ *
* @see XSSFHeaderFooter to see how to create a string with Header/Footer Formatting Syntax
- * @param text - a string representing the header.
+ * @param text - a string representing the header.
*/
@Override
public void setText(String text) {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFont.java Fri May 21 21:22:40 2021
@@ -64,7 +64,7 @@ public class XSSFFont implements Font {
private IndexedColorMap _indexedColorMap;
private ThemesTable _themes;
- private CTFont _ctFont;
+ private final CTFont _ctFont;
private int _index;
/**
@@ -113,6 +113,7 @@ public class XSSFFont implements Font {
*
* @return boolean - bold
*/
+ @Override
public boolean getBold() {
CTBooleanProperty bold = _ctFont.sizeOfBArray() == 0 ? null : _ctFont.getBArray(0);
return (bold != null && bold.getVal());
@@ -124,6 +125,7 @@ public class XSSFFont implements Font {
* @return int - character-set (0-255)
* @see FontCharset
*/
+ @Override
public int getCharSet() {
CTIntProperty charset = _ctFont.sizeOfCharsetArray() == 0 ? null : _ctFont.getCharsetArray(0);
return charset == null ? FontCharset.ANSI.getNativeId() : FontCharset.valueOf(charset.getVal()).getNativeId();
@@ -137,6 +139,7 @@ public class XSSFFont implements Font {
* @return short - indexed color to use
* @see IndexedColors
*/
+ @Override
public short getColor() {
CTColor color = _ctFont.sizeOfColorArray() == 0 ? null : _ctFont.getColorArray(0);
if (color == null) return IndexedColors.BLACK.getIndex();
@@ -194,6 +197,7 @@ public class XSSFFont implements Font {
* @return short - height in 1/20ths of a point
* @see #getFontHeightInPoints()
*/
+ @Override
public short getFontHeight() {
return (short)(getFontHeightRaw()*Font.TWIPS_PER_POINT);
}
@@ -206,6 +210,7 @@ public class XSSFFont implements Font {
* @return short - height in the familiar unit of measure - points
* @see #getFontHeight()
*/
+ @Override
public short getFontHeightInPoints() {
return (short)getFontHeightRaw();
}
@@ -227,6 +232,7 @@ public class XSSFFont implements Font {
*
* @return String - a string representing the name of the font to use
*/
+ @Override
public String getFontName() {
CTFontName name = _ctFont.sizeOfNameArray() == 0 ? null : _ctFont.getNameArray(0);
return name == null ? DEFAULT_FONT_NAME : name.getVal();
@@ -237,6 +243,7 @@ public class XSSFFont implements Font {
*
* @return boolean - value for italic
*/
+ @Override
public boolean getItalic() {
CTBooleanProperty italic = _ctFont.sizeOfIArray() == 0 ? null : _ctFont.getIArray(0);
return italic != null && italic.getVal();
@@ -247,6 +254,7 @@ public class XSSFFont implements Font {
*
* @return boolean - value for strikeout
*/
+ @Override
public boolean getStrikeout() {
CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? null : _ctFont.getStrikeArray(0);
return strike != null && strike.getVal();
@@ -260,6 +268,7 @@ public class XSSFFont implements Font {
* @see Font#SS_SUPER
* @see Font#SS_SUB
*/
+ @Override
public short getTypeOffset() {
CTVerticalAlignFontProperty vAlign = _ctFont.sizeOfVertAlignArray() == 0 ? null : _ctFont.getVertAlignArray(0);
if (vAlign == null) {
@@ -284,6 +293,7 @@ public class XSSFFont implements Font {
* @return byte - underlining type
* @see org.apache.poi.ss.usermodel.FontUnderline
*/
+ @Override
public byte getUnderline() {
CTUnderlineProperty underline = _ctFont.sizeOfUArray() == 0 ? null : _ctFont.getUArray(0);
if (underline != null) {
@@ -298,6 +308,7 @@ public class XSSFFont implements Font {
*
* @param bold - boldness to use
*/
+ @Override
public void setBold(boolean bold) {
if(bold){
CTBooleanProperty ctBold = _ctFont.sizeOfBArray() == 0 ? _ctFont.addNewB() : _ctFont.getBArray(0);
@@ -313,6 +324,7 @@ public class XSSFFont implements Font {
* @param charset - charset
* @see FontCharset
*/
+ @Override
public void setCharSet(byte charset) {
int cs = charset & 0xff;
setCharSet(cs);
@@ -324,6 +336,7 @@ public class XSSFFont implements Font {
* @param charset - charset
* @see FontCharset
*/
+ @Override
public void setCharSet(int charset) {
FontCharset fontCharset = FontCharset.valueOf(charset);
if(fontCharset != null) {
@@ -336,7 +349,6 @@ public class XSSFFont implements Font {
/**
* set character-set to use.
*
- * @param charSet
* @deprecated use {@link #setCharSet(FontCharset)} instead
*/
@Deprecated
@@ -356,7 +368,6 @@ public class XSSFFont implements Font {
/**
* set character-set to use.
*
- * @param charSet
* @since 5.0.0
*/
public void setCharSet(FontCharset charSet) {
@@ -378,6 +389,7 @@ public class XSSFFont implements Font {
* @see #DEFAULT_FONT_COLOR - Note: default font color
* @see IndexedColors
*/
+ @Override
public void setColor(short color) {
CTColor ctColor = _ctFont.sizeOfColorArray() == 0 ? _ctFont.addNewColor() : _ctFont.getColorArray(0);
switch (color) {
@@ -415,6 +427,7 @@ public class XSSFFont implements Font {
*
* @param height - height in points
*/
+ @Override
public void setFontHeight(short height) {
setFontHeight((double) height/Font.TWIPS_PER_POINT);
}
@@ -434,6 +447,7 @@ public class XSSFFont implements Font {
*
* @see #setFontHeight
*/
+ @Override
public void setFontHeightInPoints(short height) {
setFontHeight((double)height);
}
@@ -459,6 +473,7 @@ public class XSSFFont implements Font {
* @param name - value representing the name of the font to use
* @see #DEFAULT_FONT_NAME
*/
+ @Override
public void setFontName(String name) {
CTFontName fontName = _ctFont.sizeOfNameArray() == 0 ? _ctFont.addNewName() : _ctFont.getNameArray(0);
fontName.setVal(name == null ? DEFAULT_FONT_NAME : name);
@@ -471,6 +486,7 @@ public class XSSFFont implements Font {
*
* @param italic - value for italics or not
*/
+ @Override
public void setItalic(boolean italic) {
if(italic){
CTBooleanProperty bool = _ctFont.sizeOfIArray() == 0 ? _ctFont.addNewI() : _ctFont.getIArray(0);
@@ -487,6 +503,7 @@ public class XSSFFont implements Font {
*
* @param strikeout - value for strikeout or not
*/
+ @Override
public void setStrikeout(boolean strikeout) {
if(strikeout) {
CTBooleanProperty strike = _ctFont.sizeOfStrikeArray() == 0 ? _ctFont.addNewStrike() : _ctFont.getStrikeArray(0);
@@ -506,15 +523,13 @@ public class XSSFFont implements Font {
* @see #SS_SUPER
* @see #SS_SUB
*/
+ @Override
public void setTypeOffset(short offset) {
if(offset == Font.SS_NONE){
_ctFont.setVertAlignArray(null);
} else {
CTVerticalAlignFontProperty offsetProperty = _ctFont.sizeOfVertAlignArray() == 0 ? _ctFont.addNewVertAlign() : _ctFont.getVertAlignArray(0);
switch (offset) {
- case Font.SS_NONE:
- offsetProperty.setVal(STVerticalAlignRun.BASELINE);
- break;
case Font.SS_SUB:
offsetProperty.setVal(STVerticalAlignRun.SUBSCRIPT);
break;
@@ -534,6 +549,7 @@ public class XSSFFont implements Font {
* @param underline - underline type to use
* @see FontUnderline
*/
+ @Override
public void setUnderline(byte underline) {
setUnderline(FontUnderline.valueOf(underline));
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFormulaEvaluator.java Fri May 21 21:22:40 2021
@@ -103,6 +103,7 @@ public final class XSSFFormulaEvaluator
/**
* Turns a XSSFCell into a XSSFEvaluationCell
*/
+ @Override
protected EvaluationCell toEvaluationCell(Cell cell) {
if (!(cell instanceof XSSFCell)){
throw new IllegalArgumentException("Unexpected type of cell: " + cell.getClass() + "." +
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFGraphicFrame.java Fri May 21 21:22:40 2021
@@ -43,7 +43,7 @@ public final class XSSFGraphicFrame exte
private static CTGraphicalObjectFrame prototype;
- private CTGraphicalObjectFrame graphicFrame;
+ private final CTGraphicalObjectFrame graphicFrame;
/**
* Construct a new XSSFGraphicFrame object.
@@ -145,7 +145,8 @@ public final class XSSFGraphicFrame exte
* Returns the frame anchor.
* @return the XSSFClientAnchor anchor this frame is attached to
*/
- public XSSFClientAnchor getAnchor() {
+ @Override
+ public XSSFClientAnchor getAnchor() {
return (XSSFClientAnchor) anchor;
}
@@ -174,7 +175,7 @@ public final class XSSFGraphicFrame exte
/**
* The low level code to insert {@code <c:chart>} tag into
- * {@code<a:graphicData>}.
+ * {@code <a:graphicData>}.
*
* Here is the schema (ECMA-376):
* <pre>
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFHeaderFooterProperties.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFHeaderFooterProperties.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFHeaderFooterProperties.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFHeaderFooterProperties.java Fri May 21 21:22:40 2021
@@ -25,16 +25,14 @@ import org.openxmlformats.schemas.spread
* All Header/Footer properties for a sheet are scoped to the sheet. This includes Different First Page,
* and Different Even/Odd. These properties can be set or unset explicitly in this class. Note that while
* Scale With Document and Align With Margins default to unset, Different First, and Different Even/Odd
- * are updated automatically as headers and footers are added and removed.
+ * are updated automatically as headers and footers are added and removed.
* </p>
*/
public class XSSFHeaderFooterProperties {
- private CTHeaderFooter headerFooter;
+ private final CTHeaderFooter headerFooter;
/**
* Create an instance of XSSFHeaderFooterProperties from the supplied XML bean
- *
- * @param headerFooter
*/
public XSSFHeaderFooterProperties(CTHeaderFooter headerFooter) {
this.headerFooter = headerFooter;
@@ -54,58 +52,58 @@ public class XSSFHeaderFooterProperties
* returns alignWithMargins attribute
*/
public boolean getAlignWithMargins() {
- return getHeaderFooter().isSetAlignWithMargins() ? getHeaderFooter().getAlignWithMargins() : false;
+ return getHeaderFooter().isSetAlignWithMargins() && getHeaderFooter().getAlignWithMargins();
}
-
+
/**
* returns differentFirst attribute
*/
public boolean getDifferentFirst() {
- return getHeaderFooter().isSetDifferentFirst() ? getHeaderFooter().getDifferentFirst() : false;
+ return getHeaderFooter().isSetDifferentFirst() && getHeaderFooter().getDifferentFirst();
}
-
+
/**
* returns differentOddEven attribute
*/
public boolean getDifferentOddEven() {
- return getHeaderFooter().isSetDifferentOddEven() ? getHeaderFooter().getDifferentOddEven() : false;
+ return getHeaderFooter().isSetDifferentOddEven() && getHeaderFooter().getDifferentOddEven();
}
-
+
/**
* returns scaleWithDoc attribute
*/
public boolean getScaleWithDoc() {
- return getHeaderFooter().isSetScaleWithDoc() ? getHeaderFooter().getScaleWithDoc() : false;
+ return getHeaderFooter().isSetScaleWithDoc() && getHeaderFooter().getScaleWithDoc();
}
-
+
/**
* set alignWithMargins attribute
*/
public void setAlignWithMargins(boolean flag) {
getHeaderFooter().setAlignWithMargins(flag);
}
-
+
/**
* set differentFirst attribute
*/
public void setDifferentFirst(boolean flag) {
getHeaderFooter().setDifferentFirst(flag);
}
-
+
/**
* set differentOddEven attribute
*/
public void setDifferentOddEven(boolean flag) {
getHeaderFooter().setDifferentOddEven(flag);
}
-
+
/**
* set scaleWithDoc attribute
*/
public void setScaleWithDoc(boolean flag) {
getHeaderFooter().setScaleWithDoc(flag);
}
-
+
/**
* remove alignWithMargins attribute
*/
@@ -114,7 +112,7 @@ public class XSSFHeaderFooterProperties
getHeaderFooter().unsetAlignWithMargins();
}
}
-
+
/**
* remove differentFirst attribute
*/
@@ -123,7 +121,7 @@ public class XSSFHeaderFooterProperties
getHeaderFooter().unsetDifferentFirst();
}
}
-
+
/**
* remove differentOddEven attribute
*/
@@ -132,7 +130,7 @@ public class XSSFHeaderFooterProperties
getHeaderFooter().unsetDifferentOddEven();
}
}
-
+
/**
* remove scaleWithDoc attribute
*/
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFLineBreak.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFLineBreak.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFLineBreak.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFLineBreak.java Fri May 21 21:22:40 2021
@@ -38,6 +38,7 @@ class XSSFLineBreak extends XSSFTextRun
/**
* Always throws IllegalStateException. You cannot change text of a line break.
*/
+ @Override
public void setText(String text){
throw new IllegalStateException("You cannot change text of a line break, it is always '\\n'");
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddFooter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddFooter.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddFooter.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddFooter.java Fri May 21 21:22:40 2021
@@ -23,7 +23,7 @@ import org.openxmlformats.schemas.spread
/**
* Odd page footer value. Corresponds to odd printed pages.
- * Odd page(s) in the sheet may not be printed, for example, if the print area is specified to be
+ * Odd page(s) in the sheet may not be printed, for example, if the print area is specified to be
* a range such that it falls outside an odd page's scope.
*
*/
@@ -32,12 +32,11 @@ public class XSSFOddFooter extends XSSFH
/**
* Create an instance of XSSFOddFooter from the supplied XML bean
* @see XSSFSheet#getOddFooter()
- * @param headerFooter
*/
protected XSSFOddFooter(CTHeaderFooter headerFooter) {
super(headerFooter);
}
-
+
/**
* Get the content text representing the footer
* @return text
@@ -46,11 +45,11 @@ public class XSSFOddFooter extends XSSFH
public String getText() {
return getHeaderFooter().getOddFooter();
}
-
+
/**
* Set a text for the footer. If null unset the value.
* @see XSSFHeaderFooter to see how to create a string with Header/Footer Formatting Syntax
- * @param text - a string representing the footer.
+ * @param text - a string representing the footer.
*/
@Override
public void setText(String text) {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddHeader.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddHeader.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddHeader.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFOddHeader.java Fri May 21 21:22:40 2021
@@ -22,8 +22,8 @@ import org.apache.poi.xssf.usermodel.ext
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTHeaderFooter;
/**
- * Odd page header value. Corresponds to odd printed pages.
- * Odd page(s) in the sheet may not be printed, for example, if the print area is specified to be
+ * Odd page header value. Corresponds to odd printed pages.
+ * Odd page(s) in the sheet may not be printed, for example, if the print area is specified to be
* a range such that it falls outside an odd page's scope.
*
*/
@@ -32,12 +32,11 @@ public class XSSFOddHeader extends XSSFH
/**
* Create an instance of XSSFOddHeader from the supplied XML bean
* @see XSSFSheet#getOddHeader()
- * @param headerFooter
*/
protected XSSFOddHeader(CTHeaderFooter headerFooter) {
super(headerFooter);
}
-
+
/**
* Get the content text representing this header
* @return text
@@ -46,11 +45,11 @@ public class XSSFOddHeader extends XSSFH
public String getText() {
return getHeaderFooter().getOddHeader();
}
-
+
/**
* Set a text for the header. If null unset the value
* @see XSSFHeaderFooter to see how to create a string with Header/Footer Formatting Syntax
- * @param text - a string representing the header.
+ * @param text - a string representing the header.
*/
@Override
public void setText(String text) {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPicture.java Fri May 21 21:22:40 2021
@@ -46,7 +46,7 @@ import org.openxmlformats.schemas.drawin
public final class XSSFPicture extends XSSFShape implements Picture {
private static final Logger LOG = LogManager.getLogger(XSSFPicture.class);
- /**
+ /*
* Column width measured as the number of characters of the maximum digit width of the
* numbers 0, 1, 2, ..., 9 as rendered in the normal style's font. There are 4 pixels of margin
* padding (two on each side), plus 1 pixel padding for the gridlines.
@@ -63,7 +63,7 @@ public final class XSSFPicture extends X
/**
* This object specifies a picture object and all its properties
*/
- private CTPicture ctPicture;
+ private final CTPicture ctPicture;
/**
* Construct a new XSSFPicture object. This constructor is called from
@@ -140,6 +140,7 @@ public final class XSSFPicture extends X
*
* @see #resize(double, double)
*/
+ @Override
public void resize(){
resize(Double.MAX_VALUE);
}
@@ -149,6 +150,7 @@ public final class XSSFPicture extends X
*
* @see #resize(double, double)
*/
+ @Override
public void resize(double scale) {
resize(scale, scale);
}
@@ -159,19 +161,18 @@ public final class XSSFPicture extends X
* Please note, that this method works correctly only for workbooks
* with the default font size (Calibri 11pt for .xlsx).
* If the default font is changed the resized image can be streched vertically or horizontally.
- * </p>
* <p>
- * <code>resize(1.0,1.0)</code> keeps the original size,<br>
- * <code>resize(0.5,0.5)</code> resize to 50% of the original,<br>
- * <code>resize(2.0,2.0)</code> resizes to 200% of the original.<br>
+ * {@code resize(1.0,1.0)} keeps the original size,<br>
+ * {@code resize(0.5,0.5)} resize to 50% of the original,<br>
+ * {@code resize(2.0,2.0)} resizes to 200% of the original.<br>
* <code>resize({@link Double#MAX_VALUE},{@link Double#MAX_VALUE})</code> resizes to the dimension of the embedded image.
- * </p>
*
* @param scaleX the amount by which the image width is multiplied relative to the original width,
* when set to {@link Double#MAX_VALUE} the width of the embedded image is used
* @param scaleY the amount by which the image height is multiplied relative to the original height,
* when set to {@link Double#MAX_VALUE} the height of the embedded image is used
*/
+ @Override
public void resize(double scaleX, double scaleY){
XSSFClientAnchor anchor = getClientAnchor();
XSSFClientAnchor pref = getPreferredSize(scaleX,scaleY);
@@ -197,6 +198,7 @@ public final class XSSFPicture extends X
*
* @return XSSFClientAnchor with the preferred size for this image
*/
+ @Override
public XSSFClientAnchor getPreferredSize(){
return getPreferredSize(1);
}
@@ -218,6 +220,7 @@ public final class XSSFPicture extends X
* @param scaleY the amount by which image height is multiplied relative to the original height.
* @return XSSFClientAnchor with the preferred size for this image
*/
+ @Override
public XSSFClientAnchor getPreferredSize(double scaleX, double scaleY){
Dimension dim = ImageUtils.setPreferredSize(this, scaleX, scaleY);
CTPositiveSize2D size2d = ctPicture.getSpPr().getXfrm().getExt();
@@ -250,6 +253,7 @@ public final class XSSFPicture extends X
*
* @return image dimension in pixels
*/
+ @Override
public Dimension getImageDimension() {
XSSFPictureData picData = getPictureData();
return getImageDimension(picData.getPackagePart(), picData.getPictureType());
@@ -260,11 +264,13 @@ public final class XSSFPicture extends X
*
* @return picture data for this shape
*/
+ @Override
public XSSFPictureData getPictureData() {
String blipId = ctPicture.getBlipFill().getBlip().getEmbed();
return (XSSFPictureData)getDrawing().getRelationById(blipId);
}
+ @Override
protected CTShapeProperties getShapeProperties(){
return ctPicture.getSpPr();
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFShape.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFShape.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFShape.java Fri May 21 21:22:40 2021
@@ -125,8 +125,6 @@ public abstract class XSSFShape implemen
/**
* Sets the line style.
- *
- * @param lineStyle
*/
public void setLineStyle( int lineStyle ) {
CTShapeProperties props = getShapeProperties();
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTable.java Fri May 21 21:22:40 2021
@@ -32,14 +32,12 @@ import java.util.Locale;
import org.apache.poi.ooxml.POIXMLDocumentPart;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Table;
import org.apache.poi.ss.usermodel.TableStyleInfo;
import org.apache.poi.ss.util.AreaReference;
import org.apache.poi.ss.util.CellReference;
import org.apache.poi.util.Internal;
-import org.apache.poi.util.Removal;
import org.apache.poi.util.StringUtil;
import org.apache.poi.xssf.usermodel.helpers.XSSFXmlColumnPr;
import org.apache.xmlbeans.XmlException;
@@ -358,6 +356,7 @@ public class XSSFTable extends POIXMLDoc
/**
* @return the name of the Table, if set
*/
+ @Override
public String getName() {
if (name == null && ctTable.getName() != null) {
setName(ctTable.getName());
@@ -383,6 +382,7 @@ public class XSSFTable extends POIXMLDoc
* @return the table style name, if set
* @since 3.17 beta 1
*/
+ @Override
public String getStyleName() {
if (styleName == null && ctTable.isSetTableStyleInfo()) {
setStyleName(ctTable.getTableStyleInfo().getName());
@@ -628,7 +628,7 @@ public class XSSFTable extends POIXMLDoc
* and {@link #getEndCellReference()}.
* The next call to {@link #getStartCellReference()} and
* {@link #getEndCellReference()} will synchronize the
- * cell references with the underlying <code>CTTable</code>.
+ * cell references with the underlying {@code CTTable}.
* Thus this method is inexpensive.
*
* @since POI 3.15 beta 3
@@ -645,7 +645,7 @@ public class XSSFTable extends POIXMLDoc
* {@linkplain #getTotalsRowCount() totals rows}. (Note: in this version
* autofiltering is ignored)
*
- * Returns <code>0</code> if the start or end cell references are not set.
+ * Returns {@code 0} if the start or end cell references are not set.
*
* Does not track updates to underlying changes to CTTable To synchronize
* with changes to the underlying CTTable, call {@link #updateReferences()}.
@@ -667,7 +667,7 @@ public class XSSFTable extends POIXMLDoc
* Get the number of data rows in this table. This does not include any
* header rows or totals rows.
*
- * Returns <code>0</code> if the start or end cell references are not set.
+ * Returns {@code 0} if the start or end cell references are not set.
*
* Does not track updates to underlying changes to CTTable To synchronize
* with changes to the underlying CTTable, call {@link #updateReferences()}.
@@ -821,9 +821,9 @@ public class XSSFTable extends POIXMLDoc
}
/**
- * Gets the relative column index of a column in this table having the header name <code>column</code>.
+ * Gets the relative column index of a column in this table having the header name {@code column}.
* The column index is relative to the left-most column in the table, 0-indexed.
- * Returns <code>-1</code> if <code>column</code> is not a header name in table.
+ * Returns {@code -1} if {@code column} is not a header name in table.
*
* Column Header names are case-insensitive
*
@@ -832,6 +832,7 @@ public class XSSFTable extends POIXMLDoc
*
* @since 3.15 beta 2
*/
+ @Override
public int findColumnIndex(String columnHeader) {
if (columnHeader == null) return -1;
if (columnMap == null) {
@@ -849,12 +850,13 @@ public class XSSFTable extends POIXMLDoc
// Table column names with special characters need a single quote escape
// but the escape is not present in the column definition
Integer idx = columnMap.get(caseInsensitive(columnHeader.replace("'", "")));
- return idx == null ? -1 : idx.intValue();
+ return idx == null ? -1 : idx;
}
/**
* @since 3.15 beta 2
*/
+ @Override
public String getSheetName() {
return getXSSFSheet().getSheetName();
}
@@ -866,6 +868,7 @@ public class XSSFTable extends POIXMLDoc
* @since 3.15 beta 2
* @see #getTotalsRowCount()
*/
+ @Override
public boolean isHasTotalsRow() {
return ctTable.getTotalsRowShown();
}
@@ -876,6 +879,7 @@ public class XSSFTable extends POIXMLDoc
* doesn't define how they would be implemented.
* @since 3.17 beta 1
*/
+ @Override
public int getTotalsRowCount() {
return (int) ctTable.getTotalsRowCount();
}
@@ -885,6 +889,7 @@ public class XSSFTable extends POIXMLDoc
* Values > 1 might be used by Excel for pivot tables?
* @since 3.17 beta 1
*/
+ @Override
public int getHeaderRowCount() {
return (int) ctTable.getHeaderRowCount();
}
@@ -892,6 +897,7 @@ public class XSSFTable extends POIXMLDoc
/**
* @since 3.15 beta 2
*/
+ @Override
public int getStartColIndex() {
return getStartCellReference().getCol();
}
@@ -899,6 +905,7 @@ public class XSSFTable extends POIXMLDoc
/**
* @since 3.15 beta 2
*/
+ @Override
public int getStartRowIndex() {
return getStartCellReference().getRow();
}
@@ -906,6 +913,7 @@ public class XSSFTable extends POIXMLDoc
/**
* @since 3.15 beta 2
*/
+ @Override
public int getEndColIndex() {
return getEndCellReference().getCol();
}
@@ -913,6 +921,7 @@ public class XSSFTable extends POIXMLDoc
/**
* @since 3.15 beta 2
*/
+ @Override
public int getEndRowIndex() {
return getEndCellReference().getRow();
}
@@ -920,6 +929,7 @@ public class XSSFTable extends POIXMLDoc
/**
* @since 3.17 beta 1
*/
+ @Override
public TableStyleInfo getStyle() {
if (! ctTable.isSetTableStyleInfo()) return null;
return new XSSFTableStyleInfo(((XSSFSheet) getParent()).getWorkbook().getStylesSource(), ctTable.getTableStyleInfo());
@@ -929,18 +939,16 @@ public class XSSFTable extends POIXMLDoc
* @see org.apache.poi.ss.usermodel.Table#contains(org.apache.poi.ss.usermodel.Cell)
* @since 3.17 beta 1
*/
+ @Override
public boolean contains(CellReference cell) {
if (cell == null) return false;
// check if cell is on the same sheet as the table
if ( ! getSheetName().equals(cell.getSheetName())) return false;
// check if the cell is inside the table
- if (cell.getRow() >= getStartRowIndex()
+ return cell.getRow() >= getStartRowIndex()
&& cell.getRow() <= getEndRowIndex()
&& cell.getCol() >= getStartColIndex()
- && cell.getCol() <= getEndColIndex()) {
- return true;
- }
- return false;
+ && cell.getCol() <= getEndColIndex();
}
/**
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyle.java Fri May 21 21:22:40 2021
@@ -49,8 +49,6 @@ public class XSSFTableStyle implements T
/**
* @param index style definition index or built-in ordinal depending on use
- * @param dxfs
- * @param tableStyle
* @param colorMap indexed color map - default or custom
* @see TableStyle#getIndex()
*/
@@ -99,10 +97,12 @@ public class XSSFTableStyle implements T
}
}
+ @Override
public String getName() {
return name;
}
+ @Override
public int getIndex() {
return index;
}
@@ -110,10 +110,12 @@ public class XSSFTableStyle implements T
/**
* Always false for these, these are user defined styles
*/
+ @Override
public boolean isBuiltin() {
return false;
}
+ @Override
public DifferentialStyleProvider getStyle(TableStyleType type) {
return elementMap.get(type);
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableStyleInfo.java Fri May 21 21:22:40 2021
@@ -33,11 +33,7 @@ public class XSSFTableStyleInfo implemen
private boolean rowStripes;
private boolean firstColumn;
private boolean lastColumn;
-
- /**
- * @param stylesTable
- * @param tableStyleInfo
- */
+
public XSSFTableStyleInfo(StylesTable stylesTable, CTTableStyleInfo tableStyleInfo) {
this.columnStripes = tableStyleInfo.getShowColumnStripes();
this.rowStripes = tableStyleInfo.getShowRowStripes();
@@ -48,6 +44,7 @@ public class XSSFTableStyleInfo implemen
this.styleInfo = tableStyleInfo;
}
+ @Override
public boolean isShowColumnStripes() {
return columnStripes;
}
@@ -56,6 +53,7 @@ public class XSSFTableStyleInfo implemen
styleInfo.setShowColumnStripes(show);
}
+ @Override
public boolean isShowRowStripes() {
return rowStripes;
}
@@ -64,6 +62,7 @@ public class XSSFTableStyleInfo implemen
styleInfo.setShowRowStripes(show);
}
+ @Override
public boolean isShowFirstColumn() {
return firstColumn;
}
@@ -72,6 +71,7 @@ public class XSSFTableStyleInfo implemen
styleInfo.setShowFirstColumn(showFirstColumn);
}
+ @Override
public boolean isShowLastColumn() {
return lastColumn;
}
@@ -80,6 +80,7 @@ public class XSSFTableStyleInfo implemen
styleInfo.setShowLastColumn(showLastColumn);
}
+ @Override
public String getName() {
return style.getName();
}
@@ -88,6 +89,7 @@ public class XSSFTableStyleInfo implemen
style = stylesTable.getTableStyle(name);
}
+ @Override
public TableStyle getStyle() {
return style;
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextRun.java Fri May 21 21:22:40 2021
@@ -91,7 +91,7 @@ public class XSSFTextRun {
/**
*
* @param fontSize font size in points.
- * The value of <code>-1</code> unsets the Sz attribute from the underlying xml bean
+ * The value of {@code -1} unsets the Sz attribute from the underlying xml bean
*/
public void setFontSize(double fontSize){
CTTextCharacterProperties rPr = getRPr();
@@ -158,7 +158,7 @@ public class XSSFTextRun {
* Specifies the typeface, or name of the font that is to be used for this text run.
*
* @param typeface the font to apply to this text run.
- * The value of <code>null</code> unsets the Typeface attribute from the underlying xml.
+ * The value of {@code null} unsets the Typeface attribute from the underlying xml.
*/
public void setFont(String typeface){
setFontFamily(typeface, (byte)-1, (byte)-1, false);
@@ -241,9 +241,6 @@ public class XSSFTextRun {
* <p>
* The size is specified using a percentage.
* Positive values indicate superscript, negative values indicate subscript.
- * </p>
- *
- * @param baselineOffset
*/
public void setBaselineOffset(double baselineOffset){
getRPr().setBaseline((int) baselineOffset * 1000);
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVBAPart.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVBAPart.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVBAPart.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFVBAPart.java Fri May 21 21:22:40 2021
@@ -33,18 +33,19 @@ public class XSSFVBAPart extends POIXMLD
* Construct XSSFVBAPart from a package part
*
* @param part the package part holding the VBA data,
- *
+ *
* @since POI 3.14-Beta1
*/
protected XSSFVBAPart(PackagePart part) {
super(part);
}
-
+
/**
* Like *PictureData, VBA objects store the actual content in the part
* directly without keeping a copy like all others therefore we need to
* handle them differently.
*/
+ @Override
protected void prepareForCommit() {
// do not clear the part here
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/extensions/XSSFHeaderFooter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/extensions/XSSFHeaderFooter.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/extensions/XSSFHeaderFooter.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/extensions/XSSFHeaderFooter.java Fri May 21 21:22:40 2021
@@ -121,15 +121,13 @@ import org.openxmlformats.schemas.spread
*
*/
public abstract class XSSFHeaderFooter implements HeaderFooter {
- private HeaderFooterHelper helper;
- private CTHeaderFooter headerFooter;
+ private final HeaderFooterHelper helper;
+ private final CTHeaderFooter headerFooter;
private boolean stripFields;
/**
* Create an instance of XSSFAbstractHeaderFooter from the supplied XML bean
- *
- * @param headerFooter
*/
public XSSFHeaderFooter(CTHeaderFooter headerFooter) {
this.headerFooter = headerFooter;
@@ -160,7 +158,7 @@ public abstract class XSSFHeaderFooter i
/**
* Are fields currently being stripped from the text that this
- * {@link XSSFHeaderFooter} returns? Default is false, but can be changed
+ * XSSFHeaderFooter returns? Default is false, but can be changed
*/
public boolean areFieldsStripped() {
return stripFields;
@@ -169,8 +167,6 @@ public abstract class XSSFHeaderFooter i
/**
* Should fields (eg macros) be stripped from the text that this class
* returns? Default is not to strip.
- *
- * @param stripFields
*/
public void setAreFieldsStripped(boolean stripFields) {
this.stripFields = stripFields;
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java?rev=1890089&r1=1890088&r2=1890089&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFFormulaUtils.java Fri May 21 21:22:40 2021
@@ -19,7 +19,6 @@
package org.apache.poi.xssf.usermodel.helpers;
-import java.util.Iterator;
import java.util.List;
import org.apache.poi.ooxml.POIXMLDocumentPart;
@@ -59,11 +58,9 @@ public final class XSSFFormulaUtils {
* Update sheet name in all charts, formulas and named ranges.
* Called from {@link XSSFWorkbook#setSheetName(int, String)}
* <p>
- * <p>
* The idea is to parse every formula and render it back to string
* with the updated sheet name. This is done by parsing into Ptgs,
* looking for ones with sheet references in them, and changing those
- * </p>
*
* @param sheetIndex the 0-based index of the sheet being changed
* @param oldName the old sheet name
@@ -93,9 +90,7 @@ public final class XSSFFormulaUtils {
for (POIXMLDocumentPart r : rels) {
if (r instanceof XSSFDrawing) {
XSSFDrawing dg = (XSSFDrawing) r;
- Iterator<XSSFChart> it = dg.getCharts().iterator();
- while (it.hasNext()) {
- XSSFChart chart = it.next();
+ for (XSSFChart chart : dg.getCharts()) {
Node dom = chart.getCTChartSpace().getDomNode();
updateDomSheetReference(dom, oldName, newName);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org