| java.lang.Object java.io.Writer org.apache.xml.serializer.SerializerTraceWriter
SerializerTraceWriter | final class SerializerTraceWriter extends Writer implements WriterChain(Code) | | This class wraps the real writer, it only purpose is to send
CHARACTERTOSTREAM events to the trace listener.
Each method immediately sends the call to the wrapped writer unchanged, but
in addition it collects characters to be issued to a trace listener.
In this way the trace
listener knows what characters have been written to the output Writer.
There may still be differences in what the trace events say is going to the
output writer and what is really going there. These differences will be due
to the fact that this class is UTF-8 encoding before emiting the trace event
and the underlying writer may not be UTF-8 encoding. There may also be
encoding differences. So the main pupose of this class is to provide a
resonable facsimile of the true output.
|
Constructor Summary | |
public | SerializerTraceWriter(Writer out, SerializerTrace tracer) Constructor.
If the writer passed in is null, then this SerializerTraceWriter will
only signal trace events of what would have been written to that writer.
If the writer passed in is not null then the trace events will mirror
what is going to that writer. |
Method Summary | |
public void | close() | public void | flush() | public OutputStream | getOutputStream() Get the OutputStream that is the at the end of the
chain of writers. | public Writer | getWriter() Get the writer that this one directly wraps. | public void | write(int c) Write a single character. | public void | write(char chars, int start, int length) Write a portion of an array of characters. | public void | write(String s) Write a string. |
SerializerTraceWriter | public SerializerTraceWriter(Writer out, SerializerTrace tracer)(Code) | | Constructor.
If the writer passed in is null, then this SerializerTraceWriter will
only signal trace events of what would have been written to that writer.
If the writer passed in is not null then the trace events will mirror
what is going to that writer. In this way tools, such as a debugger, can
gather information on what is being written out.
Parameters: out - the Writer to write to (possibly null) Parameters: tracer - the tracer to inform that characters are being written |
getOutputStream | public OutputStream getOutputStream()(Code) | | Get the OutputStream that is the at the end of the
chain of writers.
|
getWriter | public Writer getWriter()(Code) | | Get the writer that this one directly wraps.
|
write | public void write(int c) throws IOException(Code) | | Write a single character. The character to be written is contained in
the 16 low-order bits of the given integer value; the 16 high-order bits
are ignored.
Subclasses that intend to support efficient single-character output
should override this method.
Parameters: c - int specifying a character to be written. exception: IOException - If an I/O error occurs |
write | public void write(char chars, int start, int length) throws java.io.IOException(Code) | | Write a portion of an array of characters.
Parameters: chars - Array of characters Parameters: start - Offset from which to start writing characters Parameters: length - Number of characters to write exception: IOException - If an I/O error occurs throws: java.io.IOException - |
|
|