A- the type parameter defining the arguments and options of the command
nameand the command line
arguments. To execute a command,
execute(ExecutionContext, LineProcessor)is called which returns a
LineProcessorobject to perform the line-by-line command execution.
Commands can be
joined to other commands which usually
means that the first command's output forms the input of the second command.
|Modifier and Type||Method and Description|
Executes this command and returns a
Returns the implementation specific command arguments and options for the given execution context.
Returns the name of this command, usually a lower-case string such as "grep" or "ls".
Returns a new command representing the combination of
Returns a string representation of the command instance including the argument and option values defined for the command.
A getArguments(ExecutionContext context)
VariableContextreturned by the given
contextobject. No variables are resolved if
context- the execution context with access to variables and value converters, or null if no variables should be resolved
next. The returned command executes
thiscommand first and usually joins the output to the
Note that some commands may use a slightly different interpretation of
"joining a command". The
xargs command for instance uses its
joined command as target command; the values collected by
on its input stream are passed to the target command as arguments instead
of as input.
next- the next command to join to this command
thiscommand joined to
LineProcessor execute(ExecutionContext context, LineProcessor output)
LineProcessorobject. Calling this method initiates the command execution, but the real processing of the command takes place when lines are passed to the returned
LineProcessorobject. The command execution is terminated by calling
The command writes its output to the specified
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
context- context object providing access to the current directory, environment variables and other information useful for the command during its execution
output- the output to write to
Copyright © 2022. All rights reserved.