class XargsLineProcessor extends AbstractLineProcessor<XargsArguments>
Constructor and Description |
---|
XargsLineProcessor(XargsCommand command,
ExecutionContext context,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
void |
finish()
Indicates that this line processing task is complete and can finished.
|
protected XargsArguments |
getArguments()
Returns the command arguments for the current variable context.
|
protected XargsCommand |
getCommand()
Returns the command that was passed to the constructor of this line
processor, the command whose execute method usually returns this line
processor.
|
protected XargsOutput |
getOutput()
Returns the output that was passed to the constructor of this line
processor, the object to write to when executing the command through the
this processor
|
protected VariableContext |
getVariableContext() |
protected void |
invoke() |
boolean |
processLine(Line line)
Processes a single line and returns true if this
LineProcessor is
ready to process more lines. |
getContext
public XargsLineProcessor(XargsCommand command, ExecutionContext context, LineProcessor output)
protected XargsCommand getCommand()
AbstractLineProcessor
getCommand
in class AbstractLineProcessor<XargsArguments>
protected XargsArguments getArguments()
AbstractLineProcessor
getCommand().getArguments(getContext())
.getArguments
in class AbstractLineProcessor<XargsArguments>
protected XargsOutput getOutput()
AbstractLineProcessor
getOutput
in class AbstractLineProcessor<XargsArguments>
protected VariableContext getVariableContext()
protected void invoke()
public boolean processLine(Line line)
LineProcessor
LineProcessor
is
ready to process more lines. Returning false indicates that the process
can be finished
because subsequent lines would not
change the result anyway.line
- the line to processLineProcessor
is ready to process more
lines, and false if it does not require any more input linespublic void finish()
LineProcessor
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 © 2024. All rights reserved.