public class DefaultInputProcessor extends Object implements InputProcessor
DefaultInputProcessorsimply writes every line passed to
processLine(Input, Line, LineProcessor)to the output. Subclasses often override some of the methods to enhance or modify this default behavior.
|Constructor and Description|
|Modifier and Type||Method and Description|
Indicates that the line processing task is about to start for the specified
Indicates that this line processing task is complete for the specified
Processes a single line and returns true if this
public void begin(Input input, LineProcessor output)
public boolean processLine(Input input, Line line, LineProcessor output)
InputProcessoris ready to process more lines. Returning false indicates that the process can be
finishedbecause subsequent lines would not change the result anyway.
input- the input device, the source of the given
line- the line to process
output- the output to write to
InputProcessoris ready to process more lines, and false if it does not require any more input lines
public void finish(Input input, LineProcessor output)
inputdevice and can finished.
Simple output devices usually perform a
flush operation in this
method. More complex commands may perform the real operation in this
method, for instance write the total count of lines or words to the
target file or stream.
Copyright © 2022. All rights reserved.