public class AdHocCommand extends AbstractCommand<AdHocCommand.Args>
LineOperation
.Modifier and Type | Class and Description |
---|---|
static class |
AdHocCommand.Args
Arguments for
AdHocCommand . |
Modifier and Type | Field and Description |
---|---|
static String |
NAME
The "adhoc" name for this command.
|
Constructor and Description |
---|
AdHocCommand(LineOperation operation) |
Modifier and Type | Method and Description |
---|---|
LineProcessor |
execute(ExecutionContext context,
LineProcessor output)
Executes this command and returns a
LineProcessor object. |
getArguments, getName, join, toString
public static final String NAME
public AdHocCommand(LineOperation operation)
public LineProcessor execute(ExecutionContext context, LineProcessor output)
Command
LineProcessor
object. Calling
this method initiates the command execution, but the real processing of
the command takes place when lines are passed to the returned
LineProcessor
object. The command execution is terminated by
calling LineProcessor.finish()
.
The command writes its output to the specified output
object.
Depending on the command implementation, the output is written when lines
are passed to the LineProcessor
returned by this method, or when
the execution terminates with the finish()
call.
context
- context object providing access to the current directory,
environment variables and other information useful for the
command during its executionoutput
- the output to write toCopyright © 2024. All rights reserved.