summaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-12-13 17:31:53 +0000
committerPJ Fanning <fanningpj@apache.org>2021-12-13 17:31:53 +0000
commitd6d739d5ae7ce8efa6e53ced35a940a443b9a8fc (patch)
treea274e9eb2411105d9d7c5ca9d82d6efd133fc502 /poi-ooxml
parent469a485f38686ac71fac66bc5f5279ac537a2fbb (diff)
downloadpoi-d6d739d5ae7ce8efa6e53ced35a940a443b9a8fc.tar.gz
poi-d6d739d5ae7ce8efa6e53ced35a940a443b9a8fc.zip
highlight some exceptions
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1895910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java27
-rw-r--r--poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java14
2 files changed, 41 insertions, 0 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
index 2803ffe381..39cf9c7080 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFWorkbook.java
@@ -258,6 +258,10 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
* footprint than an InputStream backed one.
*
* @param pkg the OpenXML4J {@code OPC Package} object.
+ * @throws IOException
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public XSSFWorkbook(OPCPackage pkg) throws IOException {
super(pkg);
@@ -285,6 +289,11 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
* ......
* pkg.close(); // gracefully closes the underlying zip file
* }</pre>
+ *
+ * @throws IOException
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public XSSFWorkbook(InputStream is) throws IOException {
this(PackageHelper.open(is));
@@ -301,6 +310,11 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
* than opening from an InputStream
*
* @param file the file to open
+ * @throws IOException
+ * @throws InvalidFormatException
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public XSSFWorkbook(File file) throws IOException, InvalidFormatException {
this(OPCPackage.open(file));
@@ -318,6 +332,11 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
* than opening from an InputStream
*
* @param path the file name.
+ * @throws IOException
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
+ *
*/
public XSSFWorkbook(String path) throws IOException {
this(openPackage(path));
@@ -326,6 +345,10 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
/**
* Constructs a XSSFWorkbook object using Package Part.
* @param part package part
+ * @throws IOException
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
* @since POI 4.0.0
*/
public XSSFWorkbook(PackagePart part) throws IOException {
@@ -437,6 +460,10 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
/**
* Not normally to be called externally, but possibly to be overridden to avoid
* the DOM based parse of large sheets (see examples).
+ *
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
*/
public void parseSheet(Map<String, XSSFSheet> shIdMap, CTSheet ctSheet) {
XSSFSheet sh = shIdMap.get(ctSheet.getId());
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
index 0e7116bb8e..012a09a3a6 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFDocument.java
@@ -130,6 +130,13 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
*/
private XWPFHeaderFooterPolicy headerFooterPolicy;
+ /**
+ * @param pkg OPC package
+ * @throws IOException
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
+ */
public XWPFDocument(OPCPackage pkg) throws IOException {
super(pkg);
@@ -137,6 +144,13 @@ public class XWPFDocument extends POIXMLDocument implements Document, IBody {
load(XWPFFactory.getInstance());
}
+ /**
+ * @param is InputStream
+ * @throws IOException
+ * @throws POIXMLException a RuntimeException that can be caused by invalid OOXML data
+ * @throws RuntimeException a number of other runtime exceptions can be thrown, especially if there are problems with the
+ * input format
+ */
public XWPFDocument(InputStream is) throws IOException {
super(PackageHelper.open(is));