public abstract class MultiLineReceiver extends java.lang.Object implements IShellOutputReceiver
IShellOutputReceiver, that takes the raw data coming from the
socket, and convert it into String objects.
Additionally, it splits the string by lines.
Classes extending it must implement processNewLines(String[]) which receives new
parsed lines as they become available.
| Constructor and Description |
|---|
MultiLineReceiver() |
| Modifier and Type | Method and Description |
|---|---|
void |
addOutput(byte[] data,
int offset,
int length)
Called every time some new data is available.
|
void |
done()
Terminates the process.
|
void |
flush()
Called at the end of the process execution (unless the process was
canceled).
|
abstract void |
processNewLines(java.lang.String[] lines)
Called when new lines are being received by the remote process.
|
void |
setTrimLine(boolean trim)
Set the trim lines flag.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisCancelledpublic void setTrimLine(boolean trim)
trim - whether the lines are trimmed, or not.public final void addOutput(byte[] data,
int offset,
int length)
IShellOutputReceiveraddOutput in interface IShellOutputReceiverdata - The new data.offset - The offset at which the new data starts.length - The length of the new data.public void flush()
IShellOutputReceiverflush in interface IShellOutputReceiverpublic void done()
processNewLines(String[]).public abstract void processNewLines(java.lang.String[] lines)
It is guaranteed that the lines are complete when they are given to this method.
lines - The array containing the new lines.