add or improve toString() methods of several classes for debug purposes

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1142860 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sergey Vladimirov 2011-07-05 00:48:00 +00:00
parent b8ff8ac945
commit 68aef63742
3 changed files with 27 additions and 3 deletions

View File

@ -18,12 +18,11 @@
package org.apache.poi.hwpf.model;
import org.apache.poi.util.LittleEndian;
import org.apache.poi.hwpf.usermodel.ParagraphProperties;
import org.apache.poi.hwpf.sprm.ParagraphSprmUncompressor;
import org.apache.poi.hwpf.sprm.SprmBuffer;
import org.apache.poi.hwpf.sprm.SprmOperation;
import org.apache.poi.hwpf.usermodel.ParagraphProperties;
import org.apache.poi.util.LittleEndian;
/**
* DANGER - works in bytes!
@ -145,4 +144,10 @@ public final class PAPX extends BytePropertyNode {
}
return false;
}
public String toString()
{
return "PAPX from " + getStart() + " to " + getEnd() + " (in bytes "
+ getStartBytes() + " to " + getEndBytes() + ")";
}
}

View File

@ -197,6 +197,9 @@ public final class BorderCode implements Cloneable {
@Override
public String toString()
{
if ( isEmpty() )
return "[BRC] EMPTY";
StringBuffer buffer = new StringBuffer();
buffer.append( "[BRC]\n" );

View File

@ -517,4 +517,20 @@ public class Paragraph extends Range implements Cloneable {
return retVal;
}
@Override
public String toString()
{
return toString( true );
}
public String toString( boolean withPapx )
{
return "Paragraph ("
+ getStartOffset()
+ "--"
+ getEndOffset()
+ ")"
+ ( withPapx ? "\n"
+ _props.toString().replaceAll( "\n", "\n\t" ) : "" );
}
}