public class StringDrain extends java.lang.Object implements Drain
Drain implementation gathering all output in a StringBuffer.
The result string can be accessed through the toString() method.| Constructor and Description |
|---|
StringDrain()
Constructs a new
StringDrain which will append/reconstruct newlines. |
StringDrain(boolean appendNewlines)
Creates a new
StringDrain which optionally appends newline to each processed line. |
| Modifier and Type | Method and Description |
|---|---|
void |
drain(java.lang.String line)
Callback method to process a line outputted by the process.
|
boolean |
isAppendingNewlines()
Accesses whether newline characters are appended to each consumed line.
|
java.lang.String |
toString()
Accesses the current contents of this
StringDrain. |
public StringDrain()
StringDrain which will append/reconstruct newlines.public StringDrain(boolean appendNewlines)
StringDrain which optionally appends newline to each processed line.appendNewlines - whether newlines (\n) should be appended to each line,
this would reconstruct the original contents of the output.public void drain(java.lang.String line)
drain in interface Drainline - the output line to process.Drain.drain(String)public boolean isAppendingNewlines()
public java.lang.String toString()
StringDrain.toString in class java.lang.ObjectStringBuffer, i.e. all data forwarded to this
Drain yet.Object.toString()Copyright © 2018 SAP SE. All Rights Reserved.