public class NoOp extends AbstractCommand<NoOp.Args>
CommandBuilder
. The join(Command)
method returns the joined
command only, that is, this nop
command is eliminated.Modifier and Type | Class and Description |
---|---|
static class |
NoOp.Args
Arguments for NoOp.
|
Modifier and Type | Field and Description |
---|---|
static NoOp |
INSTANCE
The singleton instance.
|
static String |
NAME
The "nop" command name.
|
Modifier and Type | Method and Description |
---|---|
LineProcessor |
execute(ExecutionContext context,
LineProcessor output)
Executes this command and returns a
LineProcessor object. |
Command<?> |
join(Command<?> next)
Returns the given
next command eliminating this NoOp
command in a join. |
getArguments, getName, toString
public static final String NAME
public Command<?> join(Command<?> next)
next
command eliminating this NoOp
command in a join.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.