]> source.dussan.org Git - poi.git/commitdiff
add Section.toString() for debug purposes
authorSergey Vladimirov <sergey@apache.org>
Tue, 5 Jul 2011 11:58:24 +0000 (11:58 +0000)
committerSergey Vladimirov <sergey@apache.org>
Tue, 5 Jul 2011 11:58:24 +0000 (11:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1143011 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hwpf/usermodel/Section.java

index 2e471d52f11acfe2e98fabb2fa02ad5d014baa8e..3e314f1f19fd9e90263b727c609a140292badd96 100644 (file)
@@ -49,5 +49,21 @@ public final class Section
      return s;
    }
 
+    @Override
+    public String toString()
+    {
+        return toString( true );
+    }
+
+    public String toString( boolean withProperties )
+    {
+        return "Section ("
+                + getStartOffset()
+                + "--"
+                + getEndOffset()
+                + ")"
+                + (withProperties ? "\n"
+                        + _props.toString().replaceAll( "\n", "\n\t" ) : "");
+    }
 
 }