Top Description Fields Constructors Methods
org.apache.derby.shared.common.error

public Class ErrorStringBuilder

extends Object
Class Inheritance
Imports
org.apache.derby.shared.common.stream.PrintWriterGetHeader, java.io.StringWriter, .PrintWriter

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

Modifier and TypeField and Description
private PrintWriterGetHeader
private PrintWriter
private StringWriter

Constructor Summary

AccessConstructor and Description
public
ErrorStringBuilder(PrintWriterGetHeader
A header getter
headerGetter
)

Construct an error string builder

Method Summary

Modifier and TypeMethod and Description
public void
append(String
the string to append
s
)

Append an error string

public void
appendln(String
the string to append
s
)

Append an error string with a newline

public StringBuffer

Returns:

an evolving string builder
get
()

Get the buffer

public void
reset()

Reset the buffer -- truncate it down to nothing.

public void
stackTrace(Throwable
the error
t
)

Print a stacktrace from the throwable in the error buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

headerGetterback to summary
private PrintWriterGetHeader headerGetter
printWriterback to summary
private PrintWriter printWriter
stringWriterback to summary
private StringWriter stringWriter

Constructor Detail

ErrorStringBuilderback to summary
public ErrorStringBuilder(PrintWriterGetHeader headerGetter)

Construct an error string builder

Parameters
headerGetter:PrintWriterGetHeader

A header getter

Method Detail

appendback to summary
public void append(String s)

Append an error string

Parameters
s:String

the string to append

appendlnback to summary
public void appendln(String s)

Append an error string with a newline

Parameters
s:String

the string to append

getback to summary
public StringBuffer get()

Get the buffer

Returns:StringBuffer

an evolving string builder

resetback to summary
public void reset()

Reset the buffer -- truncate it down to nothing.

stackTraceback to summary
public void stackTrace(Throwable t)

Print a stacktrace from the throwable in the error buffer.

Parameters
t:Throwable

the error