public class XSSFReader extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
XSSFReader.SheetIterator
Iterator over sheet data.
|
static class |
XSSFReader.XMLSheetRefReader |
static class |
XSSFReader.XSSFSheetRef |
| Modifier and Type | Field and Description |
|---|---|
protected OPCPackage |
pkg |
protected boolean |
useReadOnlySharedStringsTable |
protected PackagePart |
workbookPart |
| Constructor and Description |
|---|
XSSFReader(OPCPackage pkg)
Creates a new XSSFReader, for the given package
|
XSSFReader(OPCPackage pkg,
boolean allowStrictOoxmlFiles)
Creates a new XSSFReader, for the given package
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getSharedStringsData()
Returns an InputStream to read the contents of the
shared strings table.
|
SharedStrings |
getSharedStringsTable()
Opens up the Shared Strings Table, parses it, and
returns a handy object for working with
shared strings.
|
InputStream |
getSheet(String relId)
Returns an InputStream to read the contents of the
specified Sheet.
|
XSSFReader.SheetIterator |
getSheetIterator()
Returns an Iterator which will let you get at all the
different Sheets in turn.
|
Iterator<InputStream> |
getSheetsData()
Returns an Iterator which will let you get at all the
different Sheets in turn.
|
InputStream |
getStylesData()
Returns an InputStream to read the contents of the
styles table.
|
StylesTable |
getStylesTable()
Opens up the Styles Table, parses it, and
returns a handy object for working with cell styles
|
InputStream |
getThemesData()
Returns an InputStream to read the contents of the
themes table.
|
InputStream |
getWorkbookData()
Returns an InputStream to read the contents of the
main Workbook, which contains key overall data for
the file, including sheet definitions.
|
void |
setUseReadOnlySharedStringsTable(boolean useReadOnlySharedStringsTable)
|
boolean |
useReadOnlySharedStringsTable() |
protected OPCPackage pkg
protected PackagePart workbookPart
protected boolean useReadOnlySharedStringsTable
public XSSFReader(OPCPackage pkg) throws IOException, OpenXML4JException
OpenXML4JException - if the package format is invalidIOException - if there is an I/O issue reading the datapublic XSSFReader(OPCPackage pkg, boolean allowStrictOoxmlFiles) throws IOException, OpenXML4JException
pkg - an OPCPackage representing a spreasheet fileallowStrictOoxmlFiles - whether to try to handle Strict OOXML format filesOpenXML4JException - if the package format is invalidIOException - if there is an I/O issue reading the datapublic void setUseReadOnlySharedStringsTable(boolean useReadOnlySharedStringsTable)
useReadOnlySharedStringsTable - if true, the ReadOnlySharedStringsTable is used,
SharedStringsTable otherwisepublic boolean useReadOnlySharedStringsTable()
getSharedStringsTable() uses SharedStringsTable
or ReadOnlySharedStringsTable.public SharedStrings getSharedStringsTable() throws IOException, InvalidFormatException
SharedStringsInvalidFormatException - if the shared strings data format is invalidIOException - if there is an I/O issue reading the datasetUseReadOnlySharedStringsTable(boolean)public StylesTable getStylesTable() throws IOException, InvalidFormatException
StylesTableInvalidFormatException - if the styles data format is invalidIOException - if there is an I/O issue reading the datapublic InputStream getSharedStringsData() throws IOException, InvalidFormatException
InvalidFormatException - if the shared string data format is invalidIOException - if there is an I/O issue reading the datapublic InputStream getStylesData() throws IOException, InvalidFormatException
InvalidFormatException - if the styles data format is invalidIOException - if there is an I/O issue reading the datapublic InputStream getThemesData() throws IOException, InvalidFormatException
InvalidFormatException - if the themes data format is invalidIOException - if there is an I/O issue reading the datapublic InputStream getWorkbookData() throws IOException, InvalidFormatException
InvalidFormatException - if the sheet data format is invalidIOException - if there is an I/O issue reading the datapublic InputStream getSheet(String relId) throws IOException, InvalidFormatException
relId - The relationId of the sheet, from a r:id on the workbookInvalidFormatException - if the sheet data format is invalidIOException - if there is an I/O issue reading the datapublic Iterator<InputStream> getSheetsData() throws IOException, InvalidFormatException
InvalidFormatException - if the sheet data format is invalidIOException - if there is an I/O issue reading the datagetSheetIterator()public XSSFReader.SheetIterator getSheetIterator() throws IOException, InvalidFormatException
InvalidFormatException - if the sheet data format is invalidIOException - if there is an I/O issue reading the data