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/04/14 22:53:38 UTC
svn commit: r1888780 [3/13] - in /poi/trunk:
poi-examples/src/main/java/org/apache/poi/examples/hslf/
poi-examples/src/main/java/org/apache/poi/examples/hssf/eventusermodel/
poi-examples/src/main/java/org/apache/poi/examples/hssf/usermodel/
poi-example...
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/MapInfo.java Wed Apr 14 22:53:33 2021
@@ -37,21 +37,19 @@ import org.openxmlformats.schemas.spread
import org.openxmlformats.schemas.spreadsheetml.x2006.main.MapInfoDocument;
/**
- *
+ *
* This class implements the Custom XML Mapping Part (Open Office XML Part 1:
* chapter 12.3.6)
- *
+ *
* An instance of this part type contains a schema for an XML file, and
* information on the behavior that is used when allowing this custom XML schema
* to be mapped into the spreadsheet.
- *
- * @author Roberto Manicardi
*/
public class MapInfo extends POIXMLDocumentPart {
private CTMapInfo mapInfo;
-
+
private Map<Integer, XSSFMap> maps ;
public MapInfo() {
@@ -66,8 +64,8 @@ public class MapInfo extends POIXMLDocum
public MapInfo(PackagePart part) throws IOException {
super(part);
readFrom(part.getInputStream());
- }
-
+ }
+
public void readFrom(InputStream is) throws IOException {
try {
MapInfoDocument doc = MapInfoDocument.Factory.parse(is, DEFAULT_XML_OPTIONS);
@@ -82,7 +80,7 @@ public class MapInfo extends POIXMLDocum
throw new IOException(e.getLocalizedMessage());
}
}
-
+
/**
* Returns the parent XSSFWorkbook
*
@@ -91,14 +89,14 @@ public class MapInfo extends POIXMLDocum
public XSSFWorkbook getWorkbook() {
return (XSSFWorkbook)getParent();
}
-
+
/**
- *
+ *
* @return the internal data object
*/
public CTMapInfo getCTMapInfo(){
return mapInfo;
-
+
}
/**
@@ -117,27 +115,27 @@ public class MapInfo extends POIXMLDocum
}
return xmlSchema;
}
-
-
+
+
public XSSFMap getXSSFMapById(int id){
return maps.get(id);
}
-
+
public XSSFMap getXSSFMapByName(String name){
-
+
XSSFMap matchedMap = null;
-
+
for(XSSFMap map :maps.values()){
if(map.getCtMap().getName()!=null && map.getCtMap().getName().equals(name)){
matchedMap = map;
}
- }
-
+ }
+
return matchedMap;
}
-
+
/**
- *
+ *
* @return all the mappings configured in this document
*/
public Collection<XSSFMap> getAllXSSFMaps(){
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/model/SingleXmlCells.java Wed Apr 14 22:53:33 2021
@@ -36,16 +36,13 @@ import org.openxmlformats.schemas.spread
/**
- *
+ *
* This class implements the Single Cell Tables Part (Open Office XML Part 4:
* chapter 3.5.2)
- *
- *
- * @author Roberto Manicardi
*/
public class SingleXmlCells extends POIXMLDocumentPart {
-
-
+
+
private CTSingleXmlCells singleXMLCells;
public SingleXmlCells() {
@@ -70,7 +67,7 @@ public class SingleXmlCells extends POIX
throw new IOException(e.getLocalizedMessage());
}
}
-
+
public XSSFSheet getXSSFSheet(){
return (XSSFSheet) getParent();
}
@@ -88,21 +85,21 @@ public class SingleXmlCells extends POIX
writeTo(out);
out.close();
}
-
+
public CTSingleXmlCells getCTSingleXMLCells(){
return singleXMLCells;
}
-
+
/**
- *
+ *
* @return all the SimpleXmlCell contained in this SingleXmlCells element
*/
public List<XSSFSingleXmlCell> getAllSimpleXmlCell(){
List<XSSFSingleXmlCell> list = new Vector<>();
-
+
for(CTSingleXmlCell singleXmlCell: singleXMLCells.getSingleXmlCellArray()){
list.add(new XSSFSingleXmlCell(singleXmlCell,this));
- }
+ }
return list;
}
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/OpcOutputStream.java Wed Apr 14 22:53:33 2021
@@ -30,8 +30,6 @@ import java.util.zip.*;
* Drop in replacement for `java.util.ZipOutputStream`.
*
* For more information see https://github.com/rzymek/opczip
- *
- * @author Krzysztof Rzymkowski
*/
class OpcOutputStream extends DeflaterOutputStream {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/streaming/Zip64Impl.java Wed Apr 14 22:53:33 2021
@@ -26,8 +26,6 @@ import static java.nio.charset.StandardC
/**
* Excel compatible Zip64 implementation.
* For more information see https://github.com/rzymek/opczip
- *
- * @author Krzysztof Rzymkowski
*/
class Zip64Impl {
private static final long PK0102 = 0x02014b50L;
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/BaseXSSFEvaluationWorkbook.java Wed Apr 14 22:53:33 2021
@@ -315,6 +315,7 @@ public abstract class BaseXSSFEvaluation
}
}
+ @Override
@NotImplemented
public int getExternalSheetIndex(String workbookName, String sheetName) {
throw new RuntimeException("not implemented yet");
@@ -387,7 +388,7 @@ public abstract class BaseXSSFEvaluation
* This is meant to be used on documents whose structure is essentially static at the point formulas are evaluated.
*
* @param name the data table name (case-insensitive)
- * @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>.
+ * @return The Data table in the workbook named {@code name}, or {@code null} if no table is named {@code name}.
* @since 3.15 beta 2
*/
@Override
@@ -419,15 +420,18 @@ public abstract class BaseXSSFEvaluation
_fpBook = fpBook;
}
+ @Override
public Ptg[] getNameDefinition() {
return FormulaParser.parse(_nameRecord.getRefersToFormula(), _fpBook, FormulaType.NAMEDRANGE, _nameRecord.getSheetIndex());
}
+ @Override
public String getNameText() {
return _nameRecord.getNameName();
}
+ @Override
public boolean hasFormula() {
// TODO - no idea if this is right
CTDefinedName ctn = _nameRecord.getCTName();
@@ -435,13 +439,16 @@ public abstract class BaseXSSFEvaluation
return !ctn.getFunction() && strVal != null && strVal.length() > 0;
}
+ @Override
public boolean isFunctionName() {
return _nameRecord.isFunctionName();
}
+ @Override
public boolean isRange() {
return hasFormula(); // TODO - is this right?
}
+ @Override
public NamePtg createPtg() {
return new NamePtg(_index);
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFAutoFilter.java Wed Apr 14 22:53:33 2021
@@ -20,8 +20,6 @@ import org.apache.poi.ss.usermodel.AutoF
/**
* Represents autofiltering for the specified worksheet.
- *
- * @author Yegor Kozlov
*/
public final class XSSFAutoFilter implements AutoFilter {
private XSSFSheet _sheet;
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChartSheet.java Wed Apr 14 22:53:33 2021
@@ -40,9 +40,6 @@ import org.openxmlformats.schemas.spread
* High level representation of Sheet Parts that are of type 'chartsheet'.
* <p>
* Chart sheet is a special kind of Sheet that contains only chart and no data.
- * </p>
- *
- * @author Yegor Kozlov
*/
public class XSSFChartSheet extends XSSFSheet {
@@ -56,7 +53,8 @@ public class XSSFChartSheet extends XSSF
protected XSSFChartSheet(PackagePart part) {
super(part);
}
-
+
+ @Override
protected void read(InputStream is) throws IOException {
//initialize the supeclass with a blank worksheet
super.read(new ByteArrayInputStream(BLANK_WORKSHEET));
@@ -81,12 +79,12 @@ public class XSSFChartSheet extends XSSF
protected CTDrawing getCTDrawing() {
return chartsheet.getDrawing();
}
-
+
@Override
protected CTLegacyDrawing getCTLegacyDrawing() {
return chartsheet.getLegacyDrawing();
}
-
+
@Override
protected void write(OutputStream out) throws IOException {
XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFChildAnchor.java Wed Apr 14 22:53:33 2021
@@ -22,9 +22,6 @@ import org.openxmlformats.schemas.drawin
import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D;
import org.openxmlformats.schemas.drawingml.x2006.main.CTTransform2D;
-/**
- * @author Yegor Kozlov
- */
public final class XSSFChildAnchor extends XSSFAnchor {
private CTTransform2D t2d;
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java Wed Apr 14 22:53:33 2021
@@ -38,7 +38,6 @@ public class XSSFColor extends ExtendedC
* @return null if color is null, new instance otherwise
*/
public static XSSFColor from(CTColor color, IndexedColorMap map) {
- //noinspection deprecation
return color == null ? null : new XSSFColor(color, map);
}
@@ -84,7 +83,6 @@ public class XSSFColor extends ExtendedC
* @param colorMap The IndexedColorMap to use instead of the default one
*/
public XSSFColor(IndexedColorMap colorMap) {
- //noinspection deprecation
this(CTColor.Factory.newInstance(), colorMap);
}
@@ -115,7 +113,6 @@ public class XSSFColor extends ExtendedC
* @param colorMap The IndexedColorMap to use instead of the default one
*/
public XSSFColor(byte[] rgb, IndexedColorMap colorMap) {
- //noinspection deprecation
this(CTColor.Factory.newInstance(), colorMap);
ctColor.setRgb(rgb);
}
@@ -125,7 +122,6 @@ public class XSSFColor extends ExtendedC
* @param colorMap The IndexedColorMap to use instead of the default one
*/
public XSSFColor(IndexedColors indexedColor, IndexedColorMap colorMap) {
- //noinspection deprecation
this(CTColor.Factory.newInstance(), colorMap);
ctColor.setIndexed(indexedColor.index);
}
@@ -245,6 +241,7 @@ public class XSSFColor extends ExtendedC
return ctColor.getRgb();
}
+ @Override
protected byte[] getIndexedRGB() {
if (isIndexed()) {
if (indexedColorMap != null) return indexedColorMap.getRGB(getIndex());
@@ -262,8 +259,8 @@ public class XSSFColor extends ExtendedC
}
/**
- * Index into the <clrScheme> collection, referencing a particular <sysClr> or
- * <srgbClr> value expressed in the Theme part.
+ * Index into the {@code clrScheme} collection, referencing a particular {@code sysClr} or
+ * {@code srgbClr} value expressed in the Theme part.
*/
@Override
public int getTheme() {
@@ -271,8 +268,8 @@ public class XSSFColor extends ExtendedC
}
/**
- * Index into the <clrScheme> collection, referencing a particular <sysClr> or
- * <srgbClr> value expressed in the Theme part.
+ * Index into the {@code clrScheme} collection, referencing a particular {@code sysClr} or
+ * {@code srgbClr} value expressed in the Theme part.
* @param theme index
*/
public void setTheme(int theme) {
@@ -382,7 +379,7 @@ public class XSSFColor extends ExtendedC
}
/**
- * Checked type cast <tt>color</tt> to an XSSFColor.
+ * Checked type cast {@code color} to an XSSFColor.
*
* @param color the color to type cast
* @return the type casted color
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFConditionalFormatting.java Wed Apr 14 22:53:33 2021
@@ -27,9 +27,6 @@ import org.openxmlformats.schemas.spread
import java.util.ArrayList;
import java.util.Collections;
-/**
- * @author Yegor Kozlov
- */
public class XSSFConditionalFormatting implements ConditionalFormatting {
private final CTConditionalFormatting _cf;
private final XSSFSheet _sh;
@@ -50,7 +47,7 @@ public class XSSFConditionalFormatting i
}
/**
- * @return array of <tt>CellRangeAddress</tt>s. Never <code>null</code>
+ * @return array of {@code CellRangeAddress}s. Never {@code null}
*/
@Override
public CellRangeAddress[] getFormattingRanges() {
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=1888780&r1=1888779&r2=1888780&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 Wed Apr 14 22:53:33 2021
@@ -37,8 +37,6 @@ import org.apache.poi.util.Internal;
/**
* A connection shape drawing element. A connection shape is a line, etc.
* that connects two other shapes in this drawing.
- *
- * @author Yegor Kozlov
*/
public final class XSSFConnector extends XSSFShape {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidation.java Wed Apr 14 22:53:33 2021
@@ -31,10 +31,6 @@ import org.openxmlformats.schemas.spread
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum;
-/**
- * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a>
- *
- */
public class XSSFDataValidation implements DataValidation {
private static final int MAX_TEXT_LENGTH = 255;
@@ -93,7 +89,7 @@ public class XSSFDataValidation implemen
this.ctDataValidation = ctDataValidation;
this.regions = regions;
}
-
+
CTDataValidation getCtDataValidation() {
return ctDataValidation;
}
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=1888780&r1=1888779&r2=1888780&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 Wed Apr 14 22:53:33 2021
@@ -23,10 +23,6 @@ import org.apache.poi.ss.usermodel.DataV
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum;
-/**
- * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a>
- *
- */
public class XSSFDataValidationConstraint implements DataValidationConstraint {
/**
* Excel validation constraints with static lists are delimited with optional whitespace and the Windows List Separator,
@@ -53,10 +49,10 @@ public class XSSFDataValidationConstrain
}
this.validationType = ValidationType.LIST;
setExplicitListValues(explicitListOfValues);
-
+
validate();
}
-
+
public XSSFDataValidationConstraint(int validationType, String formula1) {
super();
setFormula1(formula1);
@@ -89,11 +85,11 @@ public class XSSFDataValidationConstrain
setFormula2(formula2);
this.validationType = validationType;
this.operator = operator;
-
+
validate();
-
+
//FIXME: Need to confirm if this is not a formula.
- // empirical testing shows Excel saves explicit lists surrounded by double quotes,
+ // empirical testing shows Excel saves explicit lists surrounded by double quotes,
// range formula expressions can't start with quotes (I think - anyone have a creative counter example?)
if ( ValidationType.LIST == validationType
&& this.formula1 != null
@@ -142,7 +138,7 @@ public class XSSFDataValidationConstrain
*/
public void setExplicitListValues(String[] explicitListValues) {
this.explicitListOfValues = explicitListValues;
-
+
// for OOXML we need to set formula1 to the quoted csv list of values (doesn't appear documented, but that's where Excel puts its lists)
// 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 ) {
@@ -155,7 +151,7 @@ public class XSSFDataValidationConstrain
builder.append(string);
}
builder.append(QUOTE);
- setFormula1(builder.toString());
+ setFormula1(builder.toString());
}
}
@@ -201,7 +197,7 @@ public class XSSFDataValidationConstrain
if (validationType==ValidationType.ANY) {
return;
}
-
+
if (validationType==ValidationType.LIST ) {
if (isFormulaEmpty(formula1)) {
throw new IllegalArgumentException("A valid formula or a list of values must be specified for list validation.");
@@ -213,7 +209,7 @@ public class XSSFDataValidationConstrain
if( isFormulaEmpty(formula1) ) {
throw new IllegalArgumentException("Formula is not specified. Formula is required for all validation types except explicit list validation.");
}
-
+
if( validationType!= ValidationType.FORMULA ) {
if (operator==-1) {
throw new IllegalArgumentException("This validation type requires an operator to be specified.");
@@ -224,7 +220,7 @@ public class XSSFDataValidationConstrain
}
}
-
+
public String prettyPrint() {
StringBuilder builder = new StringBuilder();
STDataValidationType.Enum vt = XSSFDataValidation.validationTypeMappings.get(validationType);
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDataValidationHelper.java Wed Apr 14 22:53:33 2021
@@ -30,15 +30,11 @@ import org.openxmlformats.schemas.spread
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType;
-/**
- * @author <a href="rjankiraman@emptoris.com">Radhakrishnan J</a>
- *
- */
public class XSSFDataValidationHelper implements DataValidationHelper {
// Findbugs: URF_UNREAD_FIELD. Do not delete without understanding how this class works.
//private XSSFSheet xssfSheet;
-
-
+
+
public XSSFDataValidationHelper(XSSFSheet xssfSheet) {
super();
// Findbugs: URF_UNREAD_FIELD. Do not delete without understanding how this class works.
@@ -73,8 +69,8 @@ public class XSSFDataValidationHelper im
return new XSSFDataValidationConstraint(ValidationType.LIST, listFormula);
}
-
-
+
+
public DataValidationConstraint createNumericConstraint(int validationType, int operatorType, String formula1, String formula2) {
if( validationType==ValidationType.INTEGER) {
return createIntegerConstraint(operatorType, formula1, formula2);
@@ -122,23 +118,23 @@ public class XSSFDataValidationHelper im
switch(validationType) {
case DataValidationConstraint.ValidationType.LIST:
newDataValidation.setType(STDataValidationType.LIST);
- newDataValidation.setFormula1(constraint.getFormula1());
+ newDataValidation.setFormula1(constraint.getFormula1());
break;
- case DataValidationConstraint.ValidationType.ANY:
- newDataValidation.setType(STDataValidationType.NONE);
+ case DataValidationConstraint.ValidationType.ANY:
+ newDataValidation.setType(STDataValidationType.NONE);
break;
case DataValidationConstraint.ValidationType.TEXT_LENGTH:
newDataValidation.setType(STDataValidationType.TEXT_LENGTH);
- break;
+ break;
case DataValidationConstraint.ValidationType.DATE:
newDataValidation.setType(STDataValidationType.DATE);
- break;
+ break;
case DataValidationConstraint.ValidationType.INTEGER:
newDataValidation.setType(STDataValidationType.WHOLE);
- break;
+ break;
case DataValidationConstraint.ValidationType.DECIMAL:
newDataValidation.setType(STDataValidationType.DECIMAL);
- break;
+ break;
case DataValidationConstraint.ValidationType.TIME:
newDataValidation.setType(STDataValidationType.TIME);
break;
@@ -146,9 +142,9 @@ public class XSSFDataValidationHelper im
newDataValidation.setType(STDataValidationType.CUSTOM);
break;
default:
- newDataValidation.setType(STDataValidationType.NONE);
+ newDataValidation.setType(STDataValidationType.NONE);
}
-
+
if (validationType!=ValidationType.ANY && validationType!=ValidationType.LIST) {
STDataValidationOperator.Enum op = XSSFDataValidation.operatorTypeMappings.get(constraint.getOperator());
if(op != null) {
@@ -161,7 +157,7 @@ public class XSSFDataValidationHelper im
newDataValidation.setFormula2(constraint.getFormula2());
}
}
-
+
CellRangeAddress[] cellRangeAddresses = cellRangeAddressList.getCellRangeAddresses();
List<String> sqref = new ArrayList<>();
for (int i = 0; i < cellRangeAddresses.length; i++) {
@@ -171,7 +167,7 @@ public class XSSFDataValidationHelper im
newDataValidation.setSqref(sqref);
newDataValidation.setAllowBlank(true);
newDataValidation.setErrorStyle(STDataValidationErrorStyle.STOP);
-
+
return new XSSFDataValidation(dataValidationConstraint,cellRangeAddressList,newDataValidation);
}
}
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFDialogsheet.java Wed Apr 14 22:53:33 2021
@@ -40,6 +40,7 @@ public class XSSFDialogsheet extends XSS
this.worksheet = CTWorksheet.Factory.newInstance();
}
+ @Override
public XSSFRow createRow(int rowNum) {
return null;
}
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=1888780&r1=1888779&r2=1888780&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 Wed Apr 14 22:53:33 2021
@@ -45,8 +45,6 @@ import org.openxmlformats.schemas.spread
/**
* Represents a font used in a workbook.
- *
- * @author Gisella Bronzetti
*/
public class XSSFFont implements Font {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFFontFormatting.java Wed Apr 14 22:53:33 2021
@@ -31,9 +31,6 @@ import org.openxmlformats.schemas.spread
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STUnderlineValues;
-/**
- * @author Yegor Kozlov
- */
public class XSSFFontFormatting implements FontFormatting {
private IndexedColorMap _colorMap;
private CTFont _font;
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=1888780&r1=1888779&r2=1888780&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 Wed Apr 14 22:53:33 2021
@@ -38,8 +38,6 @@ import org.w3c.dom.NodeList;
/**
* Represents DrawingML GraphicalObjectFrame.
- *
- * @author Roman Kashitsyn
*/
public final class XSSFGraphicFrame extends XSSFShape {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFMap.java Wed Apr 14 22:53:33 2021
@@ -37,11 +37,7 @@ import org.w3c.dom.Node;
* <p>
* This element contains all of the properties related to the XML map,
* and the behaviors expected during data refresh operations.
- *
- * @author Roberto Manicardi
*/
-
-
public class XSSFMap {
private CTMap ctMap;
private MapInfo mapInfo;
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFName.java Wed Apr 14 22:53:33 2021
@@ -50,12 +50,9 @@ import org.openxmlformats.schemas.spread
* name2.setRefersToFormula("Sheet1!$B$3");
*
* </blockquote></pre>
- *
- * @author Nick Burch
- * @author Yegor Kozlov
*/
public final class XSSFName implements Name {
-
+
/**
* A built-in defined name that specifies the workbook's print area
*/
@@ -356,30 +353,30 @@ public final class XSSFName implements N
XSSFName cf = (XSSFName) o;
return _ctName.toString().equals(cf.getCTName().toString());
}
-
+
/**
* https://support.office.com/en-us/article/Define-and-use-names-in-formulas-4D0F13AC-53B7-422E-AFD2-ABD7FF379C64#bmsyntax_rules_for_names
- *
+ *
* Valid characters:
* First character: { letter | underscore | backslash }
* Remaining characters: { letter | number | period | underscore }
- *
+ *
* Cell shorthand: cannot be { "C" | "c" | "R" | "r" }
- *
+ *
* Cell references disallowed: cannot be a cell reference $A$1 or R1C1
- *
+ *
* Spaces are not valid (follows from valid characters above)
- *
+ *
* Name length: (XSSF-specific?) 255 characters maximum
- *
+ *
* Case sensitivity: all names are case-insensitive
- *
+ *
* Uniqueness: must be unique (for names with the same scope)
*
* @param name
*/
private static void validateName(String name) {
-
+
if (name.length() == 0) {
throw new IllegalArgumentException("Name cannot be blank");
}
@@ -389,7 +386,7 @@ public final class XSSFName implements N
if (name.equalsIgnoreCase("R") || name.equalsIgnoreCase("C")) {
throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be special shorthand R or C");
}
-
+
// is first character valid?
char c = name.charAt(0);
String allowedSymbols = "_\\";
@@ -397,7 +394,7 @@ public final class XSSFName implements N
if (!characterIsValid) {
throw new IllegalArgumentException("Invalid name: '"+name+"': first character must be underscore or a letter");
}
-
+
// are all other characters valid?
allowedSymbols = "_.\\"; //backslashes needed for unicode escape
for (final char ch : name.toCharArray()) {
@@ -406,13 +403,13 @@ public final class XSSFName implements N
throw new IllegalArgumentException("Invalid name: '"+name+"': name must be letter, digit, period, or underscore");
}
}
-
+
// Is the name a valid $A$1 cell reference
// Because $, :, and ! are disallowed characters, A1-style references become just a letter-number combination
if (name.matches("[A-Za-z]+\\d+")) {
String col = name.replaceAll("\\d", "");
String row = name.replaceAll("[A-Za-z]", "");
-
+
try {
if (CellReference.cellReferenceIsWithinRange(col, row, SpreadsheetVersion.EXCEL2007)) {
throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be $A$1-style cell reference");
@@ -422,7 +419,7 @@ public final class XSSFName implements N
// therefore name passes the not-a-cell-reference criteria
}
}
-
+
// Is the name a valid R1C1 cell reference?
if (name.matches("[Rr]\\d+[Cc]\\d+")) {
throw new IllegalArgumentException("Invalid name: '"+name+"': cannot be R1C1-style cell reference");
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFPatternFormatting.java Wed Apr 14 22:53:33 2021
@@ -25,9 +25,6 @@ import org.openxmlformats.schemas.spread
import org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor;
import org.openxmlformats.schemas.spreadsheetml.x2006.main.STPatternType;
-/**
- * @author Yegor Kozlov
- */
public class XSSFPatternFormatting implements PatternFormatting {
IndexedColorMap _colorMap;
CTFill _fill;
@@ -82,7 +79,7 @@ public class XSSFPatternFormatting imple
ptrn.setBgColor(color);
}
}
-
+
public void setFillForegroundColor(Color fg) {
XSSFColor xcolor = XSSFColor.toXSSFColor(fg);
if (xcolor == null) setFillForegroundColor((CTColor)null);
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=1888780&r1=1888779&r2=1888780&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 Wed Apr 14 22:53:33 2021
@@ -42,8 +42,6 @@ import org.openxmlformats.schemas.drawin
/**
* Represents a picture shape in a SpreadsheetML drawing.
- *
- * @author Yegor Kozlov
*/
public final class XSSFPicture extends XSSFShape implements Picture {
private static final Logger LOG = LogManager.getLogger(XSSFPicture.class);
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Wed Apr 14 22:53:33 2021
@@ -119,6 +119,7 @@ public class XSSFSheet extends POIXMLDoc
* Kept for backwards-compatibility, use {@link Font#TWIPS_PER_POINT} instead.
* @deprecated POI 5.0.0
*/
+ @Deprecated
public static final int TWIPS_PER_POINT = Font.TWIPS_PER_POINT;
//TODO make the two variable below private!
@@ -357,7 +358,7 @@ public class XSSFSheet extends POIXMLDoc
* @param region to merge
* @param validate whether to validate merged region
* @return 0-based index of this region
- * @throws IllegalArgumentException if region contains fewer than 2 cells (this check is inexpensive and is performed regardless of <tt>validate</tt>)
+ * @throws IllegalArgumentException if region contains fewer than 2 cells (this check is inexpensive and is performed regardless of {@code validate})
* @throws IllegalStateException if region intersects with a multi-cell array formula
* @throws IllegalStateException if region intersects with an existing region on this sheet
*/
@@ -596,7 +597,7 @@ public class XSSFSheet extends POIXMLDoc
*
* @param autoCreate if true, then a new VML drawing part is created
*
- * @return the VML drawing of <code>null</code> if the drawing was not found and autoCreate=false
+ * @return the VML drawing of {@code null} if the drawing was not found and autoCreate=false
*/
protected XSSFVMLDrawing getVMLDrawing(boolean autoCreate) {
XSSFVMLDrawing drawing = null;
@@ -888,7 +889,7 @@ public class XSSFSheet extends POIXMLDoc
* Vertical page break information used for print layout view, page layout view, drawing print breaks
* in normal view, and for printing the worksheet.
*
- * @return column indexes of all the vertical page breaks, never <code>null</code>
+ * @return column indexes of all the vertical page breaks, never {@code null}
*/
@Override
public int[] getColumnBreaks() {
@@ -1070,7 +1071,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Flag indicating whether the Fit to Page print option is enabled.
*
- * @return <code>true</code>
+ * @return {@code true}
*/
@Override
public boolean getFitToPage() {
@@ -1394,7 +1395,7 @@ public class XSSFSheet extends POIXMLDoc
* Also sets some attributes on the {@link CTSheetProtection} that correspond to
* the default values used by Excel
*
- * @param password to set for protection. Pass <code>null</code> to remove protection
+ * @param password to set for protection. Pass {@code null} to remove protection
*/
@Override
public void protectSheet(String password) {
@@ -1440,7 +1441,7 @@ public class XSSFSheet extends POIXMLDoc
* defined you get a null. This is to say row 4 represents the fifth row on a sheet.
*
* @param rownum row to get
- * @return <code>XSSFRow</code> representing the rownumber or <code>null</code> if its not defined on the sheet
+ * @return {@code XSSFRow} representing the rownumber or {@code null} if its not defined on the sheet
*/
@Override
public XSSFRow getRow(int rownum) {
@@ -1492,7 +1493,7 @@ public class XSSFSheet extends POIXMLDoc
* Horizontal page break information used for print layout view, page layout view, drawing print breaks in normal
* view, and for printing the worksheet.
*
- * @return row indexes of all the horizontal page breaks, never <code>null</code>
+ * @return row indexes of all the horizontal page breaks, never {@code null}
*/
@Override
public int[] getRowBreaks() {
@@ -1511,7 +1512,7 @@ public class XSSFSheet extends POIXMLDoc
* When false a summary row is inserted above the detailed data being summarized and a new outline level
* is established on that row.
* </p>
- * @return <code>true</code> if row summaries appear below detail in the outline
+ * @return {@code true} if row summaries appear below detail in the outline
*/
@Override
public boolean getRowSumsBelow() {
@@ -1532,7 +1533,7 @@ public class XSSFSheet extends POIXMLDoc
* When false a summary row is inserted above the detailed data being summarized and a new outline level
* is established on that row.
* </p>
- * @param value <code>true</code> if row summaries appear below detail in the outline
+ * @param value {@code true} if row summaries appear below detail in the outline
*/
@Override
public void setRowSumsBelow(boolean value) {
@@ -1550,7 +1551,7 @@ public class XSSFSheet extends POIXMLDoc
* When false a summary column is inserted to the left of the detailed data being
* summarized and a new outline level is established on that column.
* </p>
- * @return <code>true</code> if col summaries appear right of the detail in the outline
+ * @return {@code true} if col summaries appear right of the detail in the outline
*/
@Override
public boolean getRowSumsRight() {
@@ -1571,7 +1572,7 @@ public class XSSFSheet extends POIXMLDoc
* When false a summary column is inserted to the left of the detailed data being
* summarized and a new outline level is established on that column.
* </p>
- * @param value <code>true</code> if col summaries appear right of the detail in the outline
+ * @param value {@code true} if col summaries appear right of the detail in the outline
*/
@Override
public void setRowSumsRight(boolean value) {
@@ -1729,7 +1730,7 @@ public class XSSFSheet extends POIXMLDoc
* Get the hidden state for a given column.
*
* @param columnIndex - the column to set (0-based)
- * @return hidden - <code>false</code> if the column is visible
+ * @return hidden - {@code false} if the column is visible
*/
@Override
public boolean isColumnHidden(int columnIndex) {
@@ -1740,7 +1741,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Gets the flag indicating whether this sheet should display formulas.
*
- * @return <code>true</code> if this sheet should display formulas.
+ * @return {@code true} if this sheet should display formulas.
*/
@Override
public boolean isDisplayFormulas() {
@@ -1752,7 +1753,7 @@ public class XSSFSheet extends POIXMLDoc
* Gets the flag indicating whether this sheet displays the lines
* between rows and columns to make editing and reading easier.
*
- * @return <code>true</code> (default) if this sheet displays gridlines.
+ * @return {@code true} (default) if this sheet displays gridlines.
* @see #isPrintGridlines() to check if printing of gridlines is turned on or off
*/
@Override
@@ -1767,7 +1768,7 @@ public class XSSFSheet extends POIXMLDoc
* To turn printing of gridlines use {@link #setPrintGridlines(boolean)}
*
*
- * @param show <code>true</code> if this sheet should display gridlines.
+ * @param show {@code true} if this sheet should display gridlines.
* @see #setPrintGridlines(boolean)
*/
@Override
@@ -1786,7 +1787,7 @@ public class XSSFSheet extends POIXMLDoc
* Column heading are the letters or numbers that appear above the columns of the sheet
* </p>
*
- * @return <code>true</code> (default) if this sheet should display row and column headings.
+ * @return {@code true} (default) if this sheet should display row and column headings.
*/
@Override
public boolean isDisplayRowColHeadings() {
@@ -1803,7 +1804,7 @@ public class XSSFSheet extends POIXMLDoc
* Column heading are the letters or numbers that appear above the columns of the sheet
* </p>
*
- * @param show <code>true</code> if this sheet should display row and column headings.
+ * @param show {@code true} if this sheet should display row and column headings.
*/
@Override
public void setDisplayRowColHeadings(boolean show) {
@@ -1862,7 +1863,7 @@ public class XSSFSheet extends POIXMLDoc
* Tests if there is a page break at the indicated row
*
* @param row index of the row to test
- * @return <code>true</code> if there is a page break at the indicated row
+ * @return {@code true} if there is a page break at the indicated row
*/
@Override
public boolean isRowBroken(int row) {
@@ -1891,8 +1892,8 @@ public class XSSFSheet extends POIXMLDoc
* Sets a page break at the indicated row
* Breaks occur above the specified row and left of the specified column inclusive.
*
- * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts
- * with columns A,B,C in the first and D,E,... in the second. Simuilar, <code>sheet.setRowBreak(2);</code>
+ * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts
+ * with columns A,B,C in the first and D,E,... in the second. Simuilar, {@code sheet.setRowBreak(2);}
* breaks the sheet into two parts with first three rows (rownum=1...3) in the first part
* and rows starting with rownum=4 in the second.
*
@@ -2100,7 +2101,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Flag indicating whether the sheet displays Automatic Page Breaks.
*
- * @return <code>true</code> if the sheet displays Automatic Page Breaks.
+ * @return {@code true} if the sheet displays Automatic Page Breaks.
*/
@Override
public boolean getAutobreaks() {
@@ -2113,7 +2114,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Flag indicating whether the sheet displays Automatic Page Breaks.
*
- * @param value <code>true</code> if the sheet displays Automatic Page Breaks.
+ * @param value {@code true} if the sheet displays Automatic Page Breaks.
*/
@Override
public void setAutobreaks(boolean value) {
@@ -2126,8 +2127,8 @@ public class XSSFSheet extends POIXMLDoc
* Sets a page break at the indicated column.
* Breaks occur above the specified row and left of the specified column inclusive.
*
- * For example, <code>sheet.setColumnBreak(2);</code> breaks the sheet into two parts
- * with columns A,B,C in the first and D,E,... in the second. Simuilar, <code>sheet.setRowBreak(2);</code>
+ * For example, {@code sheet.setColumnBreak(2);} breaks the sheet into two parts
+ * with columns A,B,C in the first and D,E,... in the second. Simuilar, {@code sheet.setRowBreak(2);}
* breaks the sheet into two parts with first three rows (rownum=1...3) in the first part
* and rows starting with rownum=4 in the second.
*
@@ -2502,7 +2503,7 @@ public class XSSFSheet extends POIXMLDoc
*
* <p>
* Character width is defined as the maximum digit width
- * of the numbers <code>0, 1, 2, ... 9</code> as rendered
+ * of the numbers {@code 0, 1, 2, ... 9} as rendered
* using the default font (first font in the workbook).
* <br>
* Unless you are using a very special font, the default character is '0' (zero),
@@ -2518,18 +2519,18 @@ public class XSSFSheet extends POIXMLDoc
* To compute the actual number of visible characters,
* Excel uses the following formula (Section 3.3.1.12 of the OOXML spec):
* </p>
- * <code>
+ * {@code
* width = Truncate([{Number of Visible Characters} *
* {Maximum Digit Width} + {5 pixel padding}]/{Maximum Digit Width}*256)/256
- * </code>
+ * }
* <p>Using the Calibri font as an example, the maximum digit width of 11 point font size is 7 pixels (at 96 dpi).
- * If you set a column width to be eight characters wide, e.g. <code>setColumnWidth(columnIndex, 8*256)</code>,
+ * If you set a column width to be eight characters wide, e.g. {@code setColumnWidth(columnIndex, 8*256)},
* then the actual value of visible characters (the value shown in Excel) is derived from the following equation:
- * <code>
+ * {@code
Truncate([numChars*7+5]/7*256)/256 = 8;
- * </code>
+ * }
*
- * which gives <code>7.29</code>.
+ * which gives {@code 7.29}.
*
* @param columnIndex - the column to set (0-based)
* @param width - the width in units of 1/256th of a character width
@@ -2555,7 +2556,7 @@ public class XSSFSheet extends POIXMLDoc
* This value does not include margin padding or extra padding for gridlines. It is only the
* number of characters.
*
- * @param width the number of characters. Default value is <code>8</code>.
+ * @param width the number of characters. Default value is {@code 8}.
*/
@Override
public void setDefaultColumnWidth(int width) {
@@ -2588,7 +2589,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Sets the flag indicating whether this sheet should display formulas.
*
- * @param show <code>true</code> if this sheet should display formulas.
+ * @param show {@code true} if this sheet should display formulas.
*/
@Override
public void setDisplayFormulas(boolean show) {
@@ -2600,7 +2601,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Flag indicating whether the Fit to Page print option is enabled.
*
- * @param b <code>true</code> if the Fit to Page print option is enabled.
+ * @param b {@code true} if the Fit to Page print option is enabled.
*/
@Override
public void setFitToPage(boolean b) {
@@ -3342,7 +3343,7 @@ public class XSSFSheet extends POIXMLDoc
* </p>
* Note: multiple sheets can be selected, but only one sheet can be active at one time.
*
- * @return <code>true</code> if this sheet is selected
+ * @return {@code true} if this sheet is selected
*/
@Override
public boolean isSelected() {
@@ -3359,7 +3360,7 @@ public class XSSFSheet extends POIXMLDoc
* </p>
* Note: multiple sheets can be selected, but only one sheet can be active at one time.
*
- * @param value <code>true</code> if this sheet is selected
+ * @param value {@code true} if this sheet is selected
*/
@Override
public void setSelected(boolean value) {
@@ -3402,7 +3403,7 @@ public class XSSFSheet extends POIXMLDoc
}
/**
- * Return location of the active cell, e.g. <code>A1</code>.
+ * Return location of the active cell, e.g. {@code A1}.
*
* @return the location of the active cell.
*/
@@ -3526,7 +3527,7 @@ public class XSSFSheet extends POIXMLDoc
* Return a master shared formula by index
*
* @param sid shared group index
- * @return a CTCellFormula bean holding shared formula or <code>null</code> if not found
+ * @return a CTCellFormula bean holding shared formula or {@code null} if not found
*/
@Internal
public CTCellFormula getSharedFormula(int sid){
@@ -4170,7 +4171,7 @@ public class XSSFSheet extends POIXMLDoc
/**
* Get background color of the sheet tab.
- * Returns <tt>null</tt> if no sheet tab color is set.
+ * Returns {@code null} if no sheet tab color is set.
*
* @return the background color of the sheet tab
*/
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheetConditionalFormatting.java Wed Apr 14 22:53:33 2021
@@ -56,7 +56,7 @@ public class XSSFSheetConditionalFormatt
* TODO - formulas containing cell references are currently not parsed properly
*
* @param comparisonOperation - a constant value from
- * <tt>{@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}</tt>: <p>
+ * {@code {@link org.apache.poi.hssf.record.CFRuleBase.ComparisonOperator}}:
* <ul>
* <li>BETWEEN</li>
* <li>NOT_BETWEEN</li>
@@ -67,12 +67,13 @@ public class XSSFSheetConditionalFormatt
* <li>GE</li>
* <li>LE</li>
* </ul>
- * </p>
+ *
* @param formula1 - formula for the valued, compared with the cell
* @param formula2 - second formula (only used with
* {@link org.apache.poi.ss.usermodel.ComparisonOperator#BETWEEN}) and
* {@link org.apache.poi.ss.usermodel.ComparisonOperator#NOT_BETWEEN} operations)
*/
+ @Override
public XSSFConditionalFormattingRule createConditionalFormattingRule(
byte comparisonOperation,
String formula1,
@@ -100,6 +101,7 @@ public class XSSFSheetConditionalFormatt
return rule;
}
+ @Override
public XSSFConditionalFormattingRule createConditionalFormattingRule(
byte comparisonOperation,
String formula) {
@@ -112,6 +114,7 @@ public class XSSFSheetConditionalFormatt
*
* @param formula - formula for the valued, compared with the cell
*/
+ @Override
public XSSFConditionalFormattingRule createConditionalFormattingRule(String formula) {
XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule(_sheet);
CTCfRule cfRule = rule.getCTCfRule();
@@ -122,12 +125,12 @@ public class XSSFSheetConditionalFormatt
/**
* Create a Databar conditional formatting rule.
- * <p>The thresholds and colour for it will be created, but will be
- * empty and require configuring with
+ * <p>The thresholds and colour for it will be created, but will be
+ * empty and require configuring with
* {@link XSSFConditionalFormattingRule#getDataBarFormatting()}
* then
* {@link XSSFDataBarFormatting#getMinThreshold()}
- * and
+ * and
* {@link XSSFDataBarFormatting#getMaxThreshold()}
*/
public XSSFConditionalFormattingRule createConditionalFormattingRule(XSSFColor color) {
@@ -139,6 +142,7 @@ public class XSSFSheetConditionalFormatt
// All done!
return rule;
}
+ @Override
public XSSFConditionalFormattingRule createConditionalFormattingRule(ExtendedColor color) {
return createConditionalFormattingRule((XSSFColor)color);
}
@@ -147,11 +151,12 @@ public class XSSFSheetConditionalFormatt
* A factory method allowing the creation of conditional formatting
* rules using an Icon Set / Multi-State formatting.
* The thresholds for it will be created, but will be empty
- * and require configuring with
+ * and require configuring with
* {@link XSSFConditionalFormattingRule#getMultiStateFormatting()}
* then
* {@link XSSFIconMultiStateFormatting#getThresholds()}
*/
+ @Override
public XSSFConditionalFormattingRule createConditionalFormattingRule(IconSet iconSet) {
XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule(_sheet);
@@ -164,14 +169,15 @@ public class XSSFSheetConditionalFormatt
/**
* Create a Color Scale / Color Gradient conditional formatting rule.
- * <p>The thresholds and colours for it will be created, but will be
- * empty and require configuring with
+ * <p>The thresholds and colours for it will be created, but will be
+ * empty and require configuring with
* {@link XSSFConditionalFormattingRule#getColorScaleFormatting()}
* then
* {@link XSSFColorScaleFormatting#getThresholds()}
* and
* {@link XSSFColorScaleFormatting#getColors()}
*/
+ @Override
public XSSFConditionalFormattingRule createConditionalFormattingColorScaleRule() {
XSSFConditionalFormattingRule rule = new XSSFConditionalFormattingRule(_sheet);
@@ -182,6 +188,7 @@ public class XSSFSheetConditionalFormatt
return rule;
}
+ @Override
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules) {
if (regions == null) {
throw new IllegalArgumentException("regions must not be null");
@@ -214,6 +221,7 @@ public class XSSFSheetConditionalFormatt
return _sheet.getCTWorksheet().sizeOfConditionalFormattingArray() - 1;
}
+ @Override
public int addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1)
{
@@ -223,6 +231,7 @@ public class XSSFSheetConditionalFormatt
});
}
+ @Override
public int addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1, ConditionalFormattingRule rule2)
{
@@ -245,6 +254,7 @@ public class XSSFSheetConditionalFormatt
* @param cf HSSFConditionalFormatting object
* @return index of the new Conditional Formatting object
*/
+ @Override
public int addConditionalFormatting( ConditionalFormatting cf ) {
XSSFConditionalFormatting xcf = (XSSFConditionalFormatting)cf;
CTWorksheet sh = _sheet.getCTWorksheet();
@@ -259,6 +269,7 @@ public class XSSFSheetConditionalFormatt
* of the Conditional Formatting object to fetch
* @return Conditional Formatting object
*/
+ @Override
public XSSFConditionalFormatting getConditionalFormattingAt(int index) {
checkIndex(index);
CTConditionalFormatting cf = _sheet.getCTWorksheet().getConditionalFormattingArray(index);
@@ -268,6 +279,7 @@ public class XSSFSheetConditionalFormatt
/**
* @return number of Conditional Formatting objects of the sheet
*/
+ @Override
public int getNumConditionalFormattings() {
return _sheet.getCTWorksheet().sizeOfConditionalFormattingArray();
}
@@ -276,6 +288,7 @@ public class XSSFSheetConditionalFormatt
* removes a Conditional Formatting object by index
* @param index of a Conditional Formatting object to remove
*/
+ @Override
public void removeConditionalFormatting(int index) {
checkIndex(index);
_sheet.getCTWorksheet().removeConditionalFormatting(index);
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=1888780&r1=1888779&r2=1888780&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 Wed Apr 14 22:53:33 2021
@@ -49,16 +49,13 @@ import org.openxmlformats.schemas.spread
import org.openxmlformats.schemas.spreadsheetml.x2006.main.TableDocument;
/**
- *
+ *
* This class implements the Table Part (Open Office XML Part 4: chapter 3.5.1)
- *
+ *
* Columns of this table may contains mappings to a subtree of an XML. The root
* element of this subtree can occur multiple times (one for each row of the
* table). The child nodes of the root element can be only attributes or
* elements with maxOccurs=1 property set.
- *
- *
- * @author Roberto Manicardi
*/
public class XSSFTable extends POIXMLDocumentPart implements Table {
@@ -67,8 +64,8 @@ public class XSSFTable extends POIXMLDoc
private transient List<XSSFTableColumn> tableColumns;
private transient HashMap<String, Integer> columnMap;
private transient CellReference startCellReference;
- private transient CellReference endCellReference;
- private transient String commonXPath;
+ private transient CellReference endCellReference;
+ private transient String commonXPath;
private transient String name;
private transient String styleName;
@@ -80,7 +77,7 @@ public class XSSFTable extends POIXMLDoc
ctTable = CTTable.Factory.newInstance();
}
- /**
+ /**
* @param part The part used to initialize the table
* @throws IOException If reading data from the part fails.
* @since POI 3.14-Beta1
@@ -89,7 +86,7 @@ public class XSSFTable extends POIXMLDoc
super(part);
readFrom(part.getInputStream());
}
-
+
/**
* Read table XML from an {@link InputStream}
* @param is The stream which provides the XML data for the table.
@@ -103,7 +100,7 @@ public class XSSFTable extends POIXMLDoc
throw new IOException(e.getLocalizedMessage());
}
}
-
+
/**
* @return owning sheet
*/
@@ -131,7 +128,7 @@ public class XSSFTable extends POIXMLDoc
writeTo(out);
out.close();
}
-
+
/**
* get the underlying CTTable XML bean
* @return underlying OOXML object
@@ -140,7 +137,7 @@ public class XSSFTable extends POIXMLDoc
public CTTable getCTTable() {
return ctTable;
}
-
+
/**
* Checks if this Table element contains even a single mapping to the map identified by id
* @param id the XSSFMap ID
@@ -148,22 +145,22 @@ public class XSSFTable extends POIXMLDoc
*/
public boolean mapsTo(long id){
List<XSSFXmlColumnPr> pointers = getXmlColumnPrs();
-
+
for (XSSFXmlColumnPr pointer: pointers) {
if (pointer.getMapId()==id) {
return true;
}
}
-
+
return false;
}
-
+
/**
- *
+ *
* Calculates the xpath of the root element for the table. This will be the common part
* of all the mapping's xpaths
* Note: this function caches the result for performance. To flush the cache {@link #updateHeaders()} must be called.
- *
+ *
* @return the xpath of the table's root element
*/
public String getCommonXpath() {
@@ -175,16 +172,16 @@ public class XSSFTable extends POIXMLDoc
String[] tokens = xpath.split("/");
if (commonTokens.length==0) {
commonTokens = tokens;
-
+
} else {
final int maxLength = Math.min(commonTokens.length, tokens.length);
-
+
for (int i =0; i<maxLength; i++) {
if (!commonTokens[i].equals(tokens[i])) {
List<String> subCommonTokens = Arrays.asList(commonTokens).subList(0, i);
-
+
String[] container = {};
-
+
commonTokens = subCommonTokens.toArray(container);
break;
}
@@ -196,7 +193,7 @@ public class XSSFTable extends POIXMLDoc
commonTokens[0] = "";
commonXPath = StringUtil.join(commonTokens, "/");
}
-
+
return commonXPath;
}
@@ -236,10 +233,10 @@ public class XSSFTable extends POIXMLDoc
}
return xmlColumnPrs;
}
-
+
/**
* Add a new column to the right end of the table.
- *
+ *
* @param columnName
* the unique name of the column, must not be {@code null}
* @return the created table column
@@ -248,10 +245,10 @@ public class XSSFTable extends POIXMLDoc
public XSSFTableColumn createColumn(String columnName) {
return createColumn(columnName, getColumnCount());
}
-
+
/**
* Adds a new column to the table.
- *
+ *
* @param columnName
* the unique name of the column, or {@code null} for a generated name
* @param columnIndex
@@ -263,20 +260,20 @@ public class XSSFTable extends POIXMLDoc
* @since 4.0.0
*/
public XSSFTableColumn createColumn(String columnName, int columnIndex) {
-
+
int columnCount = getColumnCount();
if(columnIndex < 0 || columnIndex > columnCount) {
throw new IllegalArgumentException("Column index out of bounds");
}
-
+
// Ensure we have Table Columns
CTTableColumns columns = ctTable.getTableColumns();
if (columns == null) {
columns = ctTable.addNewTableColumns();
}
-
- // check if name is unique and calculate unique column id
- long nextColumnId = 0;
+
+ // check if name is unique and calculate unique column id
+ long nextColumnId = 0;
for (XSSFTableColumn tableColumn : getColumns()) {
if (columnName != null && columnName.equalsIgnoreCase(tableColumn.getName())) {
throw new IllegalArgumentException("Column '" + columnName
@@ -286,18 +283,18 @@ public class XSSFTable extends POIXMLDoc
}
// Bug #62740, the logic was just re-using the existing max ID, not incrementing beyond it.
nextColumnId++;
-
+
// Add the new Column
CTTableColumn column = columns.insertNewTableColumn(columnIndex);
columns.setCount(columns.sizeOfTableColumnArray());
-
+
column.setId(nextColumnId);
if(columnName != null) {
- column.setName(columnName);
+ column.setName(columnName);
} else {
column.setName("Column " + nextColumnId);
}
-
+
if (ctTable.getRef() != null) {
// calculate new area
int newColumnCount = columnCount + 1;
@@ -310,12 +307,12 @@ public class XSSFTable extends POIXMLDoc
setCellRef(newTableArea);
}
-
+
updateHeaders();
-
+
return getColumns().get(columnIndex);
}
-
+
/**
* Remove a column from the table.
*
@@ -331,7 +328,7 @@ public class XSSFTable extends POIXMLDoc
updateHeaders();
}
}
-
+
/**
* Remove a column from the table.
*
@@ -346,18 +343,18 @@ public class XSSFTable extends POIXMLDoc
if (columnIndex < 0 || columnIndex > getColumnCount() - 1) {
throw new IllegalArgumentException("Column index out of bounds");
}
-
+
if(getColumnCount() == 1) {
throw new IllegalArgumentException("Table must have at least one column");
}
-
+
CTTableColumns tableColumns = ctTable.getTableColumns();
tableColumns.removeTableColumn(columnIndex);
tableColumns.setCount(tableColumns.getTableColumnList().size());
updateReferences();
updateHeaders();
}
-
+
/**
* @return the name of the Table, if set
*/
@@ -367,7 +364,7 @@ public class XSSFTable extends POIXMLDoc
}
return name;
}
-
+
/**
* Changes the name of the Table
* @param newName The name of the table.
@@ -392,7 +389,7 @@ public class XSSFTable extends POIXMLDoc
}
return styleName;
}
-
+
/**
* Changes the name of the Table
* @param newStyleName The name of the style.
@@ -412,7 +409,7 @@ public class XSSFTable extends POIXMLDoc
ctTable.getTableStyleInfo().setName(newStyleName);
styleName = newStyleName;
}
-
+
/**
* @return the display name of the Table, if set
*/
@@ -437,7 +434,7 @@ public class XSSFTable extends POIXMLDoc
*
* Does not track updates to underlying changes to CTTable To synchronize
* with changes to the underlying CTTable, call {@link #updateReferences()}.
- *
+ *
* @return the area of the table
* @see "Open Office XML Part 4: chapter 3.5.1.2, attribute ref"
* @since 3.17 beta 1
@@ -449,35 +446,35 @@ public class XSSFTable extends POIXMLDoc
SpreadsheetVersion.EXCEL2007
);
}
-
+
/**
* Set the area reference for the cells which this table covers. The area
* includes includes header rows and totals rows. Automatically synchronizes
* any changes by calling {@link #updateHeaders()}.
- *
+ *
* Note: The area's width should be identical to the amount of columns in
* the table or the table may be invalid. All header rows, totals rows and
* at least one data row must fit inside the area. Updating the area with
* this method does not create or remove any columns and does not change any
* cell values.
- *
+ *
* @see "Open Office XML Part 4: chapter 3.5.1.2, attribute ref"
* @since 3.17 beta 1
*/
public void setCellReferences(AreaReference refs) {
setCellRef(refs);
}
-
+
@Internal
protected void setCellRef(AreaReference refs) {
-
+
// Strip the sheet name,
// CTWorksheet.getTableParts defines in which sheet the table is
String ref = refs.formatAsString();
if (ref.indexOf('!') != -1) {
ref = ref.substring(ref.indexOf('!')+1);
}
-
+
// Update
ctTable.setRef(ref);
if (ctTable.isSetAutoFilter()) {
@@ -494,19 +491,19 @@ public class XSSFTable extends POIXMLDoc
}
ctTable.getAutoFilter().setRef(filterRef);
}
-
+
// Have everything recomputed
updateReferences();
updateHeaders();
}
-
+
/**
* Set the area reference for the cells which this table covers. The area
* includes includes header rows and totals rows.
- *
+ *
* Updating the area with this method will create new column as necessary to
* the right side of the table but will not modify any cell values.
- *
+ *
* @param tableArea
* the new area of the table
* @throws IllegalArgumentException
@@ -518,7 +515,7 @@ public class XSSFTable extends POIXMLDoc
if (tableArea == null) {
throw new IllegalArgumentException("AreaReference must not be null");
}
-
+
String areaSheetName = tableArea.getFirstCell().getSheetName();
if (areaSheetName != null && !areaSheetName.equals(getXSSFSheet().getSheetName())) {
// TODO to move a table from one sheet to another
@@ -526,7 +523,7 @@ public class XSSFTable extends POIXMLDoc
throw new IllegalArgumentException(
"The AreaReference must not reference a different sheet");
}
-
+
int rowCount = (tableArea.getLastCell().getRow() - tableArea.getFirstCell().getRow()) + 1;
int minimumRowCount = 1 + getHeaderRowCount() + getTotalsRowCount();
if (rowCount < minimumRowCount) {
@@ -563,7 +560,7 @@ public class XSSFTable extends POIXMLDoc
updateHeaders();
}
-
+
/**
* Get the area that this table covers.
*
@@ -580,10 +577,10 @@ public class XSSFTable extends POIXMLDoc
return null;
}
}
-
+
/**
* @return The reference for the cell in the top-left part of the table
- * (see Open Office XML Part 4: chapter 3.5.1.2, attribute ref)
+ * (see Open Office XML Part 4: chapter 3.5.1.2, attribute ref)
*
* Does not track updates to underlying changes to CTTable
* To synchronize with changes to the underlying CTTable,
@@ -595,7 +592,7 @@ public class XSSFTable extends POIXMLDoc
}
return startCellReference;
}
-
+
/**
* @return The reference for the cell in the bottom-right part of the table
* (see Open Office XML Part 4: chapter 3.5.1.2, attribute ref)
@@ -625,7 +622,7 @@ public class XSSFTable extends POIXMLDoc
}
}
-
+
/**
* Clears the cached values set by {@link #getStartCellReference()}
* and {@link #getEndCellReference()}.
@@ -641,40 +638,40 @@ public class XSSFTable extends POIXMLDoc
endCellReference = null;
}
-
+
/**
* Get the total number of rows in this table, including all
* {@linkplain #getHeaderRowCount() header rows} and all
* {@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.
- *
+ *
* Does not track updates to underlying changes to CTTable To synchronize
* with changes to the underlying CTTable, call {@link #updateReferences()}.
- *
+ *
* @return the total number of rows
*/
public int getRowCount() {
CellReference from = getStartCellReference();
CellReference to = getEndCellReference();
-
+
int rowCount = 0;
if (from!=null && to!=null) {
rowCount = to.getRow() - from.getRow() + 1;
}
return rowCount;
}
-
+
/**
* 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.
- *
+ *
* Does not track updates to underlying changes to CTTable To synchronize
* with changes to the underlying CTTable, call {@link #updateReferences()}.
- *
+ *
* @return the number of data rows
* @since 4.0.0
*/
@@ -693,11 +690,11 @@ public class XSSFTable extends POIXMLDoc
/**
* Set the number of rows in the data area of the table. This does not
* affect any header rows or totals rows.
- *
+ *
* If the new row count is less than the current row count, superfluous rows
* will be cleared. If the new row count is greater than the current row
* count, cells below the table will be overwritten by the table.
- *
+ *
* To resize the table without overwriting cells, use
* {@link #setArea(AreaReference)} instead.
*
@@ -781,14 +778,14 @@ public class XSSFTable extends POIXMLDoc
* Synchronize table headers with cell values in the parent sheet.
* Headers <em>must</em> be in sync, otherwise Excel will display a
* "Found unreadable content" message on startup.
- *
+ *
* If calling both {@link #updateReferences()} and
* this method, {@link #updateReferences()}
* should be called first.
- *
+ *
* Note that a Table <em>must</em> have a header. To reproduce
* the equivalent of inserting a table in Excel without Headers,
- * manually add cells with values of "Column1", "Column2" etc first.
+ * manually add cells with values of "Column1", "Column2" etc first.
*/
public void updateHeaders() {
XSSFSheet sheet = (XSSFSheet)getParent();
@@ -841,7 +838,7 @@ public class XSSFTable extends POIXMLDoc
// FIXME: replace with org.apache.commons.collections.map.CaseInsensitiveMap
final int count = getColumnCount();
columnMap = new HashMap<>(count * 3 / 2);
-
+
int i = 0;
for (XSSFTableColumn column : getColumns()) {
String columnName = column.getName();
@@ -872,7 +869,7 @@ public class XSSFTable extends POIXMLDoc
public boolean isHasTotalsRow() {
return ctTable.getTotalsRowShown();
}
-
+
/**
* @return 0 for no totals rows, 1 for totals row shown.
* Values > 1 are not currently used by Excel up through 2016, and the OOXML spec
@@ -891,7 +888,7 @@ public class XSSFTable extends POIXMLDoc
public int getHeaderRowCount() {
return (int) ctTable.getHeaderRowCount();
}
-
+
/**
* @since 3.15 beta 2
*/
@@ -919,7 +916,7 @@ public class XSSFTable extends POIXMLDoc
public int getEndRowIndex() {
return getEndCellReference().getRow();
}
-
+
/**
* @since 3.17 beta 1
*/
@@ -945,7 +942,7 @@ public class XSSFTable extends POIXMLDoc
}
return false;
}
-
+
/**
* Remove relations
*/
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTableColumn.java Wed Apr 14 22:53:33 2021
@@ -25,8 +25,7 @@ import org.openxmlformats.schemas.spread
/**
* A table column of an {@link XSSFTable}. Use {@link XSSFTable#createColumn} to
* create new table columns.
- *
- * @author Leonard Kappe
+ *
* @since 4.0.0
*/
public class XSSFTableColumn {
@@ -62,7 +61,7 @@ public class XSSFTableColumn {
/**
* Get the identifier of this column, which is is unique per table.
- *
+ *
* @return the column id
* @since 4.0.0
*/
@@ -72,9 +71,9 @@ public class XSSFTableColumn {
/**
* Set the identifier of this column, which must be unique per table.
- *
+ *
* It is up to the caller to enforce the uniqueness of the id.
- *
+ *
* @param columnId the column id
* @since 4.0.0
*/
@@ -84,7 +83,7 @@ public class XSSFTableColumn {
/**
* Get the name of the column, which is is unique per table.
- *
+ *
* @return the column name
* @since 4.0.0
*/
@@ -94,7 +93,7 @@ public class XSSFTableColumn {
/**
* Get the name of the column, which is is unique per table.
- *
+ *
* @param columnName the column name
* @since 4.0.0
*/
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFTextBox.java Wed Apr 14 22:53:33 2021
@@ -21,8 +21,6 @@ import org.openxmlformats.schemas.drawin
/**
* Represents a text box in a SpreadsheetML drawing.
- *
- * @author Yegor Kozlov
*/
public final class XSSFTextBox extends XSSFSimpleShape {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java Wed Apr 14 22:53:33 2021
@@ -257,7 +257,7 @@ public class XSSFWorkbook extends POIXML
}
/**
- * Constructs a XSSFWorkbook object given a OpenXML4J <code>Package</code> object,
+ * Constructs a XSSFWorkbook object given a OpenXML4J {@code Package} object,
* see <a href="https://poi.apache.org/oxml4j/">https://poi.apache.org/oxml4j/</a>.
*
* <p>Once you have finished working with the Workbook, you should close the package
@@ -267,7 +267,7 @@ public class XSSFWorkbook extends POIXML
* <p>Creating a XSSFWorkbook from a file-backed OPC Package has a lower memory
* footprint than an InputStream backed one.
*
- * @param pkg the OpenXML4J <code>OPC Package</code> object.
+ * @param pkg the OpenXML4J {@code OPC Package} object.
*/
public XSSFWorkbook(OPCPackage pkg) throws IOException {
super(pkg);
@@ -288,13 +288,13 @@ public class XSSFWorkbook extends POIXML
*
* <p>Using an {@link InputStream} requires more memory than using a File, so
* if a {@link File} is available then you should instead do something like
- * <pre><code>
+ * <pre>{@code
* OPCPackage pkg = OPCPackage.open(path);
* XSSFWorkbook wb = new XSSFWorkbook(pkg);
* // work with the wb object
* ......
* pkg.close(); // gracefully closes the underlying zip file
- * </code></pre>
+ * }</pre>
*/
public XSSFWorkbook(InputStream is) throws IOException {
this(PackageHelper.open(is));
@@ -823,11 +823,11 @@ public class XSSFWorkbook extends POIXML
* POI's SpreadsheetAPI silently truncates the input argument to 31 characters.
* Example:
*
- * <pre><code>
+ * <pre>{@code
* Sheet sheet = workbook.createSheet("My very long sheet name which is longer than 31 chars"); // will be truncated
* assert 31 == sheet.getSheetName().length();
* assert "My very long sheet name which i" == sheet.getSheetName();
- * </code></pre>
+ * }</pre>
* </p>
*
* Except the 31-character constraint, Excel applies some other rules:
@@ -928,7 +928,7 @@ public class XSSFWorkbook extends POIXML
/**
* Finds a font that matches the one with the supplied attributes
*
- * @return the font with the matched attributes or <code>null</code>
+ * @return the font with the matched attributes or {@code null}
*/
@Override
public XSSFFont findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline) {
@@ -988,7 +988,8 @@ public class XSSFWorkbook extends POIXML
* {@link #getNames(String name)} returns all named ranges with the given name.
*
* @param name named range name
- * @return XSSFName with the given name. <code>null</code> is returned no named range could be found.
+ * @return XSSFName with the given name.
+ * {@code null} is returned no named range could be found.
*/
@Override
public XSSFName getName(String name) {
@@ -1045,7 +1046,7 @@ public class XSSFWorkbook extends POIXML
* Gets the named range index by name. No longer public and only used in tests.
*
* @param name named range name
- * @return named range index. <code>-1</code> is returned if no named ranges could be found.
+ * @return named range index. {@code -1} is returned if no named ranges could be found.
*
* @deprecated 3.16. New projects should avoid accessing named ranges by index.
* Use {@link #getName(String)} instead.
@@ -1121,7 +1122,7 @@ public class XSSFWorkbook extends POIXML
* Get sheet with the given name (case insensitive match)
*
* @param name of the sheet
- * @return XSSFSheet with the name provided or <code>null</code> if it does not exist
+ * @return XSSFSheet with the name provided or {@code null} if it does not exist
*/
@Override
public XSSFSheet getSheet(String name) {
@@ -1151,7 +1152,7 @@ public class XSSFWorkbook extends POIXML
* Returns the index of the sheet by his name (case insensitive match)
*
* @param name the sheet name
- * @return index of the sheet (0 based) or <tt>-1</tt> if not found
+ * @return index of the sheet (0 based) or {@code -1} if not found
*/
@Override
public int getSheetIndex(String name) {
@@ -1169,7 +1170,7 @@ public class XSSFWorkbook extends POIXML
* Returns the index of the given sheet
*
* @param sheet the sheet to look up
- * @return index of the sheet (0 based). <tt>-1</tt> if not found
+ * @return index of the sheet (0 based). {@code -1} if not found
*/
@Override
public int getSheetIndex(Sheet sheet) {
@@ -1924,7 +1925,7 @@ public class XSSFWorkbook extends POIXML
* The calculation chain object specifies the order in which the cells in a workbook were last calculated
* </p>
*
- * @return the <code>CalculationChain</code> object or <code>null</code> if not defined
+ * @return the {@code CalculationChain} object or {@code null} if not defined
*/
@Internal
public CalculationChain getCalculationChain() {
@@ -1942,7 +1943,7 @@ public class XSSFWorkbook extends POIXML
* External Links in a formula would be '[1]Foo' which corresponds to
* entry 0 in this list.</p>
- * @return the <code>ExternalLinksTable</code> list, which may be empty
+ * @return the {@code ExternalLinksTable} list, which may be empty
*/
@Internal
public List<ExternalLinksTable> getExternalLinksTable() {
@@ -2314,7 +2315,7 @@ public class XSSFWorkbook extends POIXML
* Returns the data table with the given name (case insensitive).
*
* @param name the data table name (case-insensitive)
- * @return The Data table in the workbook named <tt>name</tt>, or <tt>null</tt> if no table is named <tt>name</tt>.
+ * @return The Data table in the workbook named {@code name}, or {@code null} if no table is named {@code name}.
* @since 3.15 beta 2
*/
public XSSFTable getTable(String name) {
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=1888780&r1=1888779&r2=1888780&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 Wed Apr 14 22:53:33 2021
@@ -45,8 +45,6 @@ import org.w3c.dom.NodeList;
/**
* Utility to update formulas and named ranges when a sheet name was changed
- *
- * @author Yegor Kozlov
*/
public final class XSSFFormulaUtils {
private final XSSFWorkbook _wb;
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFSingleXmlCell.java Wed Apr 14 22:53:33 2021
@@ -29,11 +29,6 @@ import org.openxmlformats.schemas.spread
*
* This class is a wrapper around the CTSingleXmlCell (Open Office XML Part 4:
* chapter 3.5.2.1)
- *
-
- *
- * @author Roberto Manicardi
- *
*/
public class XSSFSingleXmlCell {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/helpers/XSSFXmlColumnPr.java Wed Apr 14 22:53:33 2021
@@ -26,9 +26,6 @@ import org.openxmlformats.schemas.spread
*
* This class is a wrapper around the CTXmlColumnPr (Open Office XML Part 4:
* chapter 3.5.1.7)
- *
- *
- * @author Roberto Manicardi
*/
public class XSSFXmlColumnPr {
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java?rev=1888780&r1=1888779&r2=1888780&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xwpf/model/XWPFCommentsDecorator.java Wed Apr 14 22:53:33 2021
@@ -23,8 +23,6 @@ import org.openxmlformats.schemas.wordpr
/**
* Decorator class for XWPFParagraph allowing to add comments
* found in paragraph to its text
- *
- * @author Yury Batrakov (batrakov at gmail.com)
*/
public class XWPFCommentsDecorator extends XWPFParagraphDecorator {
private StringBuilder commentText;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org