|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
org.apache.xml.serializer.SerializerTraceWriter
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 | |
---|---|
SerializerTraceWriter(java.io.Writer out,
SerializerTrace tracer)
Constructor. |
Method Summary | |
---|---|
void |
close()
Flush the internal buffer and close the Writer |
void |
flush()
Flush the internal buffer and flush the Writer |
void |
write(char[] chars,
int start,
int length)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(java.lang.String s)
Write a string. |
Methods inherited from class java.io.Writer |
---|
write, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SerializerTraceWriter(java.io.Writer out, SerializerTrace tracer)
out
- the Writer to write to (possibly null)tracer
- the tracer to inform that characters are being writtenMethod Detail |
public void flush() throws java.io.IOException
java.io.IOException
Writer.flush()
public void close() throws java.io.IOException
java.io.IOException
Writer.close()
public void write(int c) throws java.io.IOException
Subclasses that intend to support efficient single-character output should override this method.
c
- int specifying a character to be written.
java.io.IOException
- If an I/O error occurspublic void write(char[] chars, int start, int length) throws java.io.IOException
chars
- Array of charactersstart
- Offset from which to start writing characterslength
- Number of characters to write
java.io.IOException
- If an I/O error occurs
java.io.IOException
public void write(java.lang.String s) throws java.io.IOException
s
- String to be written
java.io.IOException
- If an I/O error occurs
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |