public class WriterOutput extends Object implements Output
Writer
.Modifier | Constructor and Description |
---|---|
|
WriterOutput(Writer writer) |
protected |
WriterOutput(Writer writer,
boolean closeWriterOnFinish) |
Modifier and Type | Method and Description |
---|---|
void |
finish()
Indicates that all output has been written.
|
protected Writer |
getWriter()
Returns the underlying writer that was passed to the constructor.
|
boolean |
processLine(Line line)
Writes a line to the output.
|
protected boolean |
writeLastLineEnding()
Returns true if the last line ending should be written.
|
public WriterOutput(Writer writer)
protected WriterOutput(Writer writer, boolean closeWriterOnFinish)
protected Writer getWriter()
public boolean processLine(Line line)
Output
processLine
in interface Output
processLine
in interface LineProcessor
line
- the line to write to the output.Output
device is ready to process more
lines, and false otherwise; output devices usually return truepublic void finish()
Output
finish
in interface Output
finish
in interface LineProcessor
protected boolean writeLastLineEnding()
This default implementation always returns true, but certain subclasses
such as StringOutput
sometimes return false when the last line
should not be terminated with a line ending.
Copyright © 2024. All rights reserved.