LineProcessors
and LineProcessors
@Deprecated public final class LineProcessors extends Object
LineProcessor
classes.
Note that main difference between InputProcessor
and
LineProcessor
is that LineProcessor always process whole lines.
Modifier and Type | Method and Description |
---|---|
static LineProcessor |
patternWaiting(Pattern pattern,
CountDownLatch latch)
Deprecated.
Returns the processor that will wait for the line matching the pattern,
decreasing the latch when such line appears for the first time.
|
static LineProcessor |
printing(OutputWriter out,
boolean resetEnabled)
Deprecated.
Returns the processor printing all lines passed for processing to
the given output writer.
|
static LineProcessor |
printing(OutputWriter out,
LineConvertor convertor,
boolean resetEnabled)
Deprecated.
Returns the processor converting lines with convertor and
printing the result to the given output writer.
|
static LineProcessor |
proxy(LineProcessor... processors)
Deprecated.
Returns the processor acting as a proxy.
|
@NonNull public static LineProcessor proxy(@NonNull LineProcessor... processors)
Any action taken on this processor is distributed to all processors passed as arguments in the same order as they were passed to this method.
Returned processor is not thread safe.
processors
- processor to which the actions will be ditributed@NonNull public static LineProcessor printing(@NonNull OutputWriter out, boolean resetEnabled)
Reset action on the returned processor resets the writer if it is enabled
by passing true
as resetEnabled
. Processor
closes the output writer on InputProcessor.close()
.
Returned processor is not thread safe.
out
- where to print received linesresetEnabled
- determines whether the reset operation will work
(will reset the writer if so)@NonNull public static LineProcessor printing(@NonNull OutputWriter out, @NullAllowed LineConvertor convertor, boolean resetEnabled)
null
) raw
lines are printed.
Reset action on the returned processor resets the writer if it is enabled
by passing true
as resetEnabled
. Processor
closes the output writer on InputProcessor.close()
.
Returned processor is not thread safe.
out
- where to print converted lines and charactersconvertor
- convertor converting the lines before printing,
may be null
resetEnabled
- determines whether the reset operation will work
(will reset the writer if so)LineConvertor
@NonNull public static LineProcessor patternWaiting(@NonNull Pattern pattern, @NonNull CountDownLatch latch)
Reset action on the returned processor is noop.
Returned processor is thread safe.
pattern
- pattern that line must match in order decrease the latchlatch
- latch to decrease when the line matching the pattern appears
for the first time