|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.apache.poi.xssf.eventusermodel.ReadOnlySharedStringsTable
public class ReadOnlySharedStringsTable
This is a lightweight way to process the Shared Strings table. Most of the text cells will reference something from in here.
Note that each SI entry can have multiple T elements, if the string is made up of bits with different formatting.
Example input:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="2" uniqueCount="2">
<si>
<r>
<rPr>
<b />
<sz val="11" />
<color theme="1" />
<rFont val="Calibri" />
<family val="2" />
<scheme val="minor" />
</rPr>
<t>This:</t>
</r>
<r>
<rPr>
<sz val="11" />
<color theme="1" />
<rFont val="Calibri" />
<family val="2" />
<scheme val="minor" />
</rPr>
<t xml:space="preserve">Causes Problems</t>
</r>
</si>
<si>
<t>This does not</t>
</si>
</sst>
| Constructor Summary | |
|---|---|
ReadOnlySharedStringsTable(OPCPackage pkg)
|
|
ReadOnlySharedStringsTable(PackagePart part,
PackageRelationship rel_ignored)
Like POIXMLDocumentPart constructor |
|
| Method Summary | |
|---|---|
void |
characters(char[] ch,
int start,
int length)
Captures characters only if a t(ext) element is open. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name)
|
int |
getCount()
Return an integer representing the total count of strings in the workbook. |
java.lang.String |
getEntryAt(int idx)
Return the string at a given index. |
java.util.List |
getItems()
|
int |
getUniqueCount()
Returns an integer representing the total count of unique strings in the Shared String Table. |
void |
readFrom(java.io.InputStream is)
Read this shared strings table from an XML file. |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes attributes)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReadOnlySharedStringsTable(OPCPackage pkg)
throws java.io.IOException,
org.xml.sax.SAXException
pkg -
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
public ReadOnlySharedStringsTable(PackagePart part,
PackageRelationship rel_ignored)
throws java.io.IOException,
org.xml.sax.SAXException
part - rel_ignored -
java.io.IOException
org.xml.sax.SAXException| Method Detail |
|---|
public void readFrom(java.io.InputStream is)
throws java.io.IOException,
org.xml.sax.SAXException
is - The input stream containing the XML document.
java.io.IOException - if an error occurs while reading.
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationExceptionpublic int getCount()
public int getUniqueCount()
public java.lang.String getEntryAt(int idx)
idx - index of item to return.
public java.util.List getItems()
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String name)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||