Class XSSFReader
java.lang.Object
org.apache.poi.xssf.eventusermodel.XSSFReader
- Direct Known Subclasses:
XSSFBReader
This class makes it easy to get at individual parts
of an OOXML .xlsx file, suitable for low memory sax
parsing or similar.
It makes up the core part of the EventUserModel support
for XSSF.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Iterator over sheet data.static class
static final class
-
Constructor Summary
ConstructorDescriptionXSSFReader
(OPCPackage pkg) Creates a new XSSFReader, for the given packageXSSFReader
(OPCPackage pkg, boolean allowStrictOoxmlFiles) Creates a new XSSFReader, for the given package -
Method Summary
Modifier and TypeMethodDescriptionReturns an InputStream to read the contents of the shared strings table.Opens up the Shared Strings Table, parses it, and returns a handy object for working with shared strings.Returns an InputStream to read the contents of the specified Sheet.Returns an Iterator which will let you get at all the different Sheets in turn.Returns an InputStream to read the contents of the styles table.Opens up the Styles Table, parses it, and returns a handy object for working with cell stylesReturns an InputStream to read the contents of the themes table.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
-
Constructor Details
-
XSSFReader
Creates a new XSSFReader, for the given package- Throws:
IOException
OpenXML4JException
-
XSSFReader
public XSSFReader(OPCPackage pkg, boolean allowStrictOoxmlFiles) throws IOException, OpenXML4JException Creates a new XSSFReader, for the given package- Parameters:
pkg
- anOPCPackage
representing a spreasheet fileallowStrictOoxmlFiles
- whether to try to handle Strict OOXML format files- Throws:
IOException
OpenXML4JException
-
-
Method Details
-
getStylesTable
Opens up the Styles Table, parses it, and returns a handy object for working with cell styles- Throws:
IOException
InvalidFormatException
-
getStylesData
Returns an InputStream to read the contents of the styles table.- Throws:
IOException
InvalidFormatException
-
getThemesData
Returns an InputStream to read the contents of the themes table.- Throws:
IOException
InvalidFormatException
-
getWorkbookData
Returns an InputStream to read the contents of the main Workbook, which contains key overall data for the file, including sheet definitions.- Throws:
IOException
InvalidFormatException
-
getSheet
Returns an InputStream to read the contents of the specified Sheet.- Parameters:
relId
- The relationId of the sheet, from a r:id on the workbook- Throws:
IOException
InvalidFormatException
-
getSheetsData
Returns an Iterator which will let you get at all the different Sheets in turn. Each sheet's InputStream is only opened when fetched from the Iterator. It's up to you to close the InputStreams when done with each one.- Throws:
IOException
InvalidFormatException