]> source.dussan.org Git - poi.git/commitdiff
Add Enum method to help identifying unknown records with POI-Visualizer
authorAndreas Beeker <kiwiwings@apache.org>
Fri, 28 Dec 2018 23:42:57 +0000 (23:42 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Fri, 28 Dec 2018 23:42:57 +0000 (23:42 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1849897 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hslf/record/UnknownRecordPlaceholder.java

index db928f29aca3533eef6756ed209065e877ba5476..4790ae1ee690e87793fa710784d654047ca2e8aa 100644 (file)
 
 package org.apache.poi.hslf.record;
 
-import org.apache.poi.util.IOUtils;
-import org.apache.poi.util.LittleEndian;
 import java.io.IOException;
 import java.io.OutputStream;
 
+import org.apache.poi.util.IOUtils;
+import org.apache.poi.util.LittleEndian;
+
 /**
  * If we come across a record we don't know about, we create one of
  *  these. It allows us to keep track of what it contains, so we can
@@ -30,6 +31,7 @@ import java.io.OutputStream;
  * @author Nick Burch
  */
 
+@SuppressWarnings("unused")
 public final class UnknownRecordPlaceholder extends RecordAtom
 {
 
@@ -56,7 +58,16 @@ public final class UnknownRecordPlaceholder extends RecordAtom
        /**
         * Return the value we were given at creation
         */
-       public long getRecordType() { return _type; }
+       public long getRecordType() {
+               return _type;
+       }
+
+       /**
+        * Return the value as enum we were given at creation
+        */
+       public RecordTypes getRecordTypeEnum() {
+               return RecordTypes.forTypeID((int)_type);
+       }
 
        /**
         * Write the contents of the record back, so it can be written