diff options
author | PJ Fanning <fanningpj@apache.org> | 2018-07-25 13:09:54 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2018-07-25 13:09:54 +0000 |
commit | a99abc5ff856e1348439c7d8dd55fb0531fe2b66 (patch) | |
tree | 154b834a9553c7377c03752c32a1291bca28bb75 | |
parent | 555923c40b49f6ce2b0ffb7220fe4be16a71cdbc (diff) | |
download | poi-a99abc5ff856e1348439c7d8dd55fb0531fe2b66.tar.gz poi-a99abc5ff856e1348439c7d8dd55fb0531fe2b66.zip |
make ReadOnlySharedStringsTable subclassable
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1836627 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java index e17e259e82..4879e347f8 100644 --- a/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java +++ b/src/ooxml/java/org/apache/poi/xssf/eventusermodel/ReadOnlySharedStringsTable.java @@ -23,9 +23,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.PushbackInputStream; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; @@ -79,19 +77,20 @@ import org.xml.sax.helpers.DefaultHandler; */ public class ReadOnlySharedStringsTable extends DefaultHandler { - private final boolean includePhoneticRuns; + protected final boolean includePhoneticRuns; + /** * An integer representing the total count of strings in the workbook. This count does not * include any numbers, it counts only the total of text strings in the workbook. */ - private int count; + protected int count; /** * An integer representing the total count of unique strings in the Shared String Table. * A string is unique even if it is a copy of another string, but has different formatting applied * at the character level. */ - private int uniqueCount; + protected int uniqueCount; /** * The shared strings table. @@ -99,12 +98,6 @@ public class ReadOnlySharedStringsTable extends DefaultHandler { private List<String> strings; /** - * Map of phonetic strings (if they exist) indexed - * with the integer matching the index in strings - */ - private Map<Integer, String> phoneticStrings; - - /** * Calls {{@link #ReadOnlySharedStringsTable(OPCPackage, boolean)}} with * a value of <code>true</code> for including phonetic runs * @@ -240,7 +233,6 @@ public class ReadOnlySharedStringsTable extends DefaultHandler { if(uniqueCount != null) this.uniqueCount = Integer.parseInt(uniqueCount); this.strings = new ArrayList<>(this.uniqueCount); - this.phoneticStrings = new HashMap<>(); characters = new StringBuilder(64); } else if ("si".equals(localName)) { characters.setLength(0); @@ -255,8 +247,7 @@ public class ReadOnlySharedStringsTable extends DefaultHandler { } } - public void endElement(String uri, String localName, String name) - throws SAXException { + public void endElement(String uri, String localName, String name) throws SAXException { if (uri != null && ! uri.equals(NS_SPREADSHEETML)) { return; } @@ -273,8 +264,7 @@ public class ReadOnlySharedStringsTable extends DefaultHandler { /** * Captures characters only if a t(ext) element is open. */ - public void characters(char[] ch, int start, int length) - throws SAXException { + public void characters(char[] ch, int start, int length) throws SAXException { if (tIsOpen) { if (inRPh && includePhoneticRuns) { characters.append(ch, start, length); |