// Number or string?
try {
+ //noinspection ResultOfMethodCallIgnored
Double.parseDouble(formattedValue);
output.append(formattedValue);
} catch (NumberFormatException e) {
* Parses and shows the content of one sheet
* using the specified styles and shared-strings tables.
*
- * @param styles
- * @param strings
- * @param sheetInputStream
+ * @param styles The table of styles that may be referenced by cells in the sheet
+ * @param strings The table of strings that may be referenced by cells in the sheet
+ * @param sheetInputStream The stream to read the sheet-data from.
+
+ * @exception java.io.IOException An IO exception from the parser,
+ * possibly from a byte stream or character stream
+ * supplied by the application.
+ * @throws SAXException if parsing the XML data fails.
*/
public void processSheet(
StylesTable styles,
ReadOnlySharedStringsTable strings,
SheetContentsHandler sheetHandler,
- InputStream sheetInputStream)
- throws IOException, ParserConfigurationException, SAXException {
+ InputStream sheetInputStream) throws IOException, SAXException {
DataFormatter formatter = new DataFormatter();
InputSource sheetSource = new InputSource(sheetInputStream);
try {
/**
* Initiates the processing of the XLS workbook file to CSV.
*
- * @throws IOException
- * @throws OpenXML4JException
- * @throws ParserConfigurationException
- * @throws SAXException
+ * @throws IOException If reading the data from the package fails.
+ * @throws SAXException if parsing the XML data fails.
*/
- public void process()
- throws IOException, OpenXML4JException, ParserConfigurationException, SAXException {
+ public void process() throws IOException, OpenXML4JException, SAXException {
ReadOnlySharedStringsTable strings = new ReadOnlySharedStringsTable(this.xlsxPackage);
XSSFReader xssfReader = new XSSFReader(this.xlsxPackage);
StylesTable styles = xssfReader.getStylesTable();
* @throws InvalidOperationException
* If a writing operation is done on a read only package or
* invalid nested relations are created.
- * @throws InvalidFormatException
- * If the URI point to a relationship part URI.
- * @throws IllegalArgumentException if targetPartName, targetMode
+ * @throws IllegalArgumentException if targetPartName, targetMode
* or relationshipType are passed as null
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addRelationship(org.apache.poi.openxml4j.opc.PackagePartName,
* org.apache.poi.openxml4j.opc.TargetMode, java.lang.String, java.lang.String)
* Relationship unique id.
* @return The newly created and added relationship
*
- * @throws InvalidFormatException
+ * @throws InvalidOperationException
* If the URI point to a relationship part URI.
* @see org.apache.poi.openxml4j.opc.RelationshipSource#addRelationship(org.apache.poi.openxml4j.opc.PackagePartName,
* org.apache.poi.openxml4j.opc.TargetMode, java.lang.String, java.lang.String)
* Retrieve all the relationships attached to this part.
*
* @return This part's relationships.
- * @throws OpenXML4JException
+ * @throws InvalidOperationException
+ * Throws if the package is open en write only mode.
* @see org.apache.poi.openxml4j.opc.RelationshipSource#getRelationships()
*/
public PackageRelationshipCollection getRelationships()
*
* @return The input stream of the content of this part, else
* <code>null</code>.
+ *
+ * @throws IOException If creating the input-stream fails.
*/
public InputStream getInputStream() throws IOException {
InputStream inStream = this.getInputStreamImpl();
/**
* Get the output stream of this part. If the part is originally embedded in
- * Zip package, it'll be transform intot a <i>MemoryPackagePart</i> in
+ * Zip package, it'll be transform into a <i>MemoryPackagePart</i> in
* order to write inside (the standard Java API doesn't allow to write in
* the file)
*
@Override
public String toString() {
return "Name: " + this._partName + " - Content Type: "
- + this._contentType.toString();
+ + this._contentType;
}
/**
/*-------------- Abstract methods ------------- */
/**
- * Abtract method that get the input stream of this part.
+ * Abstract method that get the input stream of this part.
*
* @exception IOException
* Throws if an IO Exception occur in the implementation
private List<String> strings;
/**
- * @param pkg
- * @throws IOException
- * @throws SAXException
- * @throws ParserConfigurationException
+ * @param pkg The {@link OPCPackage} to use as basis for the shared-strings table.
+ * @throws IOException If reading the data from the package fails.
+ * @throws SAXException if parsing the XML data fails.
*/
public ReadOnlySharedStringsTable(OPCPackage pkg)
throws IOException, SAXException {
* Read this shared strings table from an XML file.
*
* @param is The input stream containing the XML document.
- * @throws IOException if an error occurs while reading.
- * @throws SAXException
- * @throws ParserConfigurationException
+ * @throws IOException if an error occurs while reading.
+ * @throws SAXException if parsing the XML data fails.
*/
public void readFrom(InputStream is) throws IOException, SAXException {
// test if the file is empty, otherwise parse it