Package de.ubs.xdm3.util
Class ScriptLogWriter
java.lang.Object
java.io.Writer
de.ubs.xdm3.util.ScriptLogWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
A custom writer that logs script output line by line using a provided handler.
This class extends the
Writer class and buffers the output until a newline character is encountered.
The buffered line is then passed to the handler for processing.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface for handling printed lines. -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ScriptLogWriter with the specified handler. -
Method Summary
-
Constructor Details
-
ScriptLogWriter
Constructs a new ScriptLogWriter with the specified handler.- Parameters:
handler- the handler to process the lines written by this writer
-
-
Method Details
-
write
public void write(int c) -
write
public void write(char[] cbuf, int off, int len) -
flush
public void flush() -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-