Package org.apache.derby.iapi.error
Class ErrorStringBuilder
- java.lang.Object
-
- org.apache.derby.iapi.error.ErrorStringBuilder
-
public class ErrorStringBuilder extends java.lang.Object
Class used to form error messages. Primary reason for existence is to allow a way to call printStackTrace() w/o automatically writting to a stream.
-
-
Field Summary
Fields Modifier and Type Field Description private PrintWriterGetHeader
headerGetter
private java.io.PrintWriter
printWriter
private java.io.StringWriter
stringWriter
-
Constructor Summary
Constructors Constructor Description ErrorStringBuilder(PrintWriterGetHeader headerGetter)
Construct an error string builder
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(java.lang.String s)
Append an error stringvoid
appendln(java.lang.String s)
Append an error string with a newlinejava.lang.StringBuffer
get()
Get the buffervoid
reset()
Reset the buffer -- truncate it down to nothing.void
stackTrace(java.lang.Throwable t)
Print a stacktrace from the throwable in the error buffer.
-
-
-
Field Detail
-
stringWriter
private java.io.StringWriter stringWriter
-
printWriter
private java.io.PrintWriter printWriter
-
headerGetter
private PrintWriterGetHeader headerGetter
-
-
Constructor Detail
-
ErrorStringBuilder
public ErrorStringBuilder(PrintWriterGetHeader headerGetter)
Construct an error string builder
-
-
Method Detail
-
append
public void append(java.lang.String s)
Append an error string- Parameters:
s
- the string to append
-
appendln
public void appendln(java.lang.String s)
Append an error string with a newline- Parameters:
s
- the string to append
-
stackTrace
public void stackTrace(java.lang.Throwable t)
Print a stacktrace from the throwable in the error buffer.- Parameters:
t
- the error
-
reset
public void reset()
Reset the buffer -- truncate it down to nothing.
-
get
public java.lang.StringBuffer get()
Get the buffer
-
-