mirror of https://github.com/apache/poi.git
Apply some IDE suggestions and fix some JavaDoc
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1885012 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
685af351d1
commit
8347bb64ac
|
@ -188,9 +188,11 @@ public abstract class BaseFormulaEvaluator implements FormulaEvaluator, Workbook
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set the cell type
|
* Set the cell type based on the computed cell type as
|
||||||
* @param cell
|
* part of a formula evaluation.
|
||||||
* @param cv
|
*
|
||||||
|
* @param cell The Cell to populate
|
||||||
|
* @param cv The CellValue to read the result type from
|
||||||
*/
|
*/
|
||||||
protected void setCellType(Cell cell, CellValue cv) {
|
protected void setCellType(Cell cell, CellValue cv) {
|
||||||
CellType cellType = cv.getCellType();
|
CellType cellType = cv.getCellType();
|
||||||
|
@ -214,10 +216,12 @@ public abstract class BaseFormulaEvaluator implements FormulaEvaluator, Workbook
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override if a different variation is needed, e.g. passing the evaluator to the cell method
|
* Override if a different variation is needed, e.g. passing the evaluator to the cell method
|
||||||
* @param cell
|
*
|
||||||
* @param cellType
|
* @param cell The Cell to populate
|
||||||
|
* @param cellType The wanted type for this Cell
|
||||||
*/
|
*/
|
||||||
protected void setCellType(Cell cell, CellType cellType) {
|
protected void setCellType(Cell cell, CellType cellType) {
|
||||||
|
//noinspection deprecation
|
||||||
cell.setCellType(cellType);
|
cell.setCellType(cellType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ import org.apache.poi.ss.usermodel.Row;
|
||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.util.Internal;
|
import org.apache.poi.util.Internal;
|
||||||
import org.apache.poi.util.Removal;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -193,7 +193,7 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write out this document to an Outputstream.
|
* Write out this document to an {@link OutputStream}.
|
||||||
*
|
*
|
||||||
* Note - if the Document was opened from a {@link File} rather
|
* Note - if the Document was opened from a {@link File} rather
|
||||||
* than an {@link InputStream}, you <b>must</b> write out to
|
* than an {@link InputStream}, you <b>must</b> write out to
|
||||||
|
|
|
@ -57,7 +57,7 @@ public class POIXMLDocumentPart {
|
||||||
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
|
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
|
||||||
private PackagePart packagePart;
|
private PackagePart packagePart;
|
||||||
private POIXMLDocumentPart parent;
|
private POIXMLDocumentPart parent;
|
||||||
private Map<String, RelationPart> relations = new LinkedHashMap<>();
|
private final Map<String, RelationPart> relations = new LinkedHashMap<>();
|
||||||
private boolean isCommitted = false;
|
private boolean isCommitted = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -361,7 +361,7 @@ public class POIXMLDocumentPart {
|
||||||
* <p>
|
* <p>
|
||||||
* If there are multiple relationships to the same part, this will only
|
* If there are multiple relationships to the same part, this will only
|
||||||
* remove the first relationship in the order of creation. The removal
|
* remove the first relationship in the order of creation. The removal
|
||||||
* via the part id ({@link #removeRelation(String)} is preferred.
|
* via the part id ({@link #removeRelation(POIXMLDocumentPart)} is preferred.
|
||||||
*
|
*
|
||||||
* @param partId the part id which relation is to be removed from this document
|
* @param partId the part id which relation is to be removed from this document
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
|
@ -380,7 +380,7 @@ public class POIXMLDocumentPart {
|
||||||
* @return true, if the relation was removed
|
* @return true, if the relation was removed
|
||||||
* @since 4.0.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
private final boolean removeRelation(String partId, boolean removeUnusedParts) {
|
private boolean removeRelation(String partId, boolean removeUnusedParts) {
|
||||||
RelationPart rp = relations.get(partId);
|
RelationPart rp = relations.get(partId);
|
||||||
if (rp == null) {
|
if (rp == null) {
|
||||||
// part is not related with this POIXMLDocumentPart
|
// part is not related with this POIXMLDocumentPart
|
||||||
|
|
|
@ -379,7 +379,7 @@ public final class ZipPackage extends OPCPackage {
|
||||||
* Delete a part from the package
|
* Delete a part from the package
|
||||||
*
|
*
|
||||||
* @throws IllegalArgumentException
|
* @throws IllegalArgumentException
|
||||||
* Throws if the part URI is nulll or invalid.
|
* Throws if the part URI is null or invalid.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void removePartImpl(PackagePartName partName) {
|
protected void removePartImpl(PackagePartName partName) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.poi.ss.usermodel.Cell;
|
||||||
* calls to evaluate~ methods on this class.
|
* calls to evaluate~ methods on this class.
|
||||||
*/
|
*/
|
||||||
public final class XSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator {
|
public final class XSSFFormulaEvaluator extends BaseXSSFFormulaEvaluator {
|
||||||
private XSSFWorkbook _book;
|
private final XSSFWorkbook _book;
|
||||||
|
|
||||||
public XSSFFormulaEvaluator(XSSFWorkbook workbook) {
|
public XSSFFormulaEvaluator(XSSFWorkbook workbook) {
|
||||||
this(workbook, null, null);
|
this(workbook, null, null);
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
|
||||||
* The locator of user-defined functions.
|
* The locator of user-defined functions.
|
||||||
* By default includes functions from the Excel Analysis Toolpack
|
* By default includes functions from the Excel Analysis Toolpack
|
||||||
*/
|
*/
|
||||||
private IndexedUDFFinder _udfFinder = new IndexedUDFFinder(AggregatingUDFFinder.DEFAULT);
|
private final IndexedUDFFinder _udfFinder = new IndexedUDFFinder(AggregatingUDFFinder.DEFAULT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO
|
* TODO
|
||||||
|
@ -214,7 +214,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
|
||||||
*/
|
*/
|
||||||
private List<XSSFPictureData> pictures;
|
private List<XSSFPictureData> pictures;
|
||||||
|
|
||||||
private static POILogger logger = POILogFactory.getLogger(XSSFWorkbook.class);
|
private static final POILogger logger = POILogFactory.getLogger(XSSFWorkbook.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* cached instance of XSSFCreationHelper for this workbook
|
* cached instance of XSSFCreationHelper for this workbook
|
||||||
|
@ -404,7 +404,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
|
||||||
// Load individual sheets. The order of sheets is defined by the order
|
// Load individual sheets. The order of sheets is defined by the order
|
||||||
// of CTSheet elements in the workbook
|
// of CTSheet elements in the workbook
|
||||||
sheets = new ArrayList<>(shIdMap.size());
|
sheets = new ArrayList<>(shIdMap.size());
|
||||||
//noinspection deprecation
|
|
||||||
for (CTSheet ctSheet : this.workbook.getSheets().getSheetArray()) {
|
for (CTSheet ctSheet : this.workbook.getSheets().getSheetArray()) {
|
||||||
parseSheet(shIdMap, ctSheet);
|
parseSheet(shIdMap, ctSheet);
|
||||||
}
|
}
|
||||||
|
@ -1604,7 +1603,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
|
||||||
newcts.set(cts);
|
newcts.set(cts);
|
||||||
|
|
||||||
//notify sheets
|
//notify sheets
|
||||||
//noinspection deprecation
|
|
||||||
CTSheet[] sheetArray = ct.getSheetArray();
|
CTSheet[] sheetArray = ct.getSheetArray();
|
||||||
for(int i=0; i < sheetArray.length; i++) {
|
for(int i=0; i < sheetArray.length; i++) {
|
||||||
sheets.get(i).sheet = sheetArray[i];
|
sheets.get(i).sheet = sheetArray[i];
|
||||||
|
@ -1773,7 +1771,6 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
|
||||||
* @return true if the sheet contains the name, false otherwise.
|
* @return true if the sheet contains the name, false otherwise.
|
||||||
*/
|
*/
|
||||||
private boolean containsSheet(String name, int excludeSheetIdx) {
|
private boolean containsSheet(String name, int excludeSheetIdx) {
|
||||||
//noinspection deprecation
|
|
||||||
CTSheet[] ctSheetArray = workbook.getSheets().getSheetArray();
|
CTSheet[] ctSheetArray = workbook.getSheets().getSheetArray();
|
||||||
|
|
||||||
if (name.length() > MAX_SENSITIVE_SHEET_NAME_LEN) {
|
if (name.length() > MAX_SENSITIVE_SHEET_NAME_LEN) {
|
||||||
|
|
Loading…
Reference in New Issue