InputProcessors
and InputProcessors
public final class InputProcessors extends Object
InputProcessor
classes.Modifier and Type | Method and Description |
---|---|
static InputProcessor |
ansiStripping(InputProcessor delegate)
Deprecated.
Returns the processor that strips any
ANSI escape sequences
and passes the result to the delegate.
|
static InputProcessor |
bridge(LineProcessor lineProcessor)
Deprecated.
Returns the processor converting characters to the whole lines passing
them to the given line processor.
|
static InputProcessor |
copying(Writer writer)
Deprecated.
Returns the processor that writes every character passed for processing
to the given writer.
|
static InputProcessor |
printing(OutputWriter out,
boolean resetEnabled)
Deprecated.
Returns the processor printing all characters passed for processing to
the given output writer.
|
static InputProcessor |
printing(OutputWriter out,
LineConvertor convertor,
boolean resetEnabled)
Deprecated.
Returns the processor converting whole lines with convertor and
printing the result including unterminated tail (if present) to the
given output writer.
|
static InputProcessor |
proxy(InputProcessor... processors)
Deprecated.
Returns the processor acting as a proxy.
|
@NonNull public static InputProcessor bridge(@NonNull LineProcessor lineProcessor)
Any reset or close is delegated to the corresponding method of line processor.
Returned processor is not thread safe.
lineProcessor
- processor consuming parsed lines@NonNull public static InputProcessor proxy(@NonNull InputProcessor... 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 InputProcessor copying(@NonNull Writer writer)
Reset action on the returned processor is noop. Processor closes the
writer on InputProcessor.close()
.
Returned processor is not thread safe.
writer
- processed characters will be written to this writer@NonNull public static InputProcessor 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 charactersresetEnabled
- determines whether the reset operation will work
(will reset the writer if so)@NonNull public static InputProcessor 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 whole lines
before printing, may be null
resetEnabled
- determines whether the reset operation will work
(will reset the writer if so)LineConvertor
@NonNull public static InputProcessor ansiStripping(@NonNull InputProcessor delegate)
Reset and close methods on the returned processor invokes the corresponding actions on delegate.
Returned processor is not thread safe.
delegate
- processor that will receive characters without control
sequences