public class StringOutput extends WriterOutput
Constructor and Description |
---|
StringOutput()
Constructor for
StringOutput that does NOT terminated the last
line with a line ending no matter whether the last input line has an
empty line ending or not. |
StringOutput(boolean writeLastLineEnding)
Constructor with flag indicating whether the last line ending should be
written or not when
WriterOutput.finish() is called. |
Modifier and Type | Method and Description |
---|---|
protected StringWriter |
getWriter()
Returns the underlying writer that was passed to the constructor.
|
String |
toString()
Return the buffer's current value as a string.
|
boolean |
writeLastLineEnding()
Returns true if the last line ending should be written.
|
finish, processLine
public StringOutput()
StringOutput
that does NOT terminated the last
line with a line ending no matter whether the last input line has an
empty line ending or not.public StringOutput(boolean writeLastLineEnding)
WriterOutput.finish()
is called.writeLastLineEnding
- if true the line ending of the last line is written to the
outputprotected StringWriter getWriter()
WriterOutput
getWriter
in class WriterOutput
public boolean writeLastLineEnding()
WriterOutput
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.
writeLastLineEnding
in class WriterOutput
Copyright © 2024. All rights reserved.