Class AbstractCommandExecutor
java.lang.Object
gov.nist.secauto.metaschema.cli.processor.command.AbstractCommandExecutor
- All Implemented Interfaces:
ICommandExecutor
A base class for implementation that perform the operation supported by a
command.
-
Nested Class Summary
Nested classes/interfaces inherited from interface gov.nist.secauto.metaschema.cli.processor.command.ICommandExecutor
ICommandExecutor.ExecutionFunction
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractCommandExecutor
(CLIProcessor.CallingContext callingContext, org.apache.commons.cli.CommandLine commandLine) Construct a new command executor. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
execute()
Execute the command operation.protected CLIProcessor.CallingContext
Get the context of the command execution, which provides access to the execution environment needed for command processing.protected ICommand
Get the command associated with this execution.protected org.apache.commons.cli.CommandLine
Get the parsed command line details containing the command options and arguments provided by the user during execution.
-
Constructor Details
-
AbstractCommandExecutor
protected AbstractCommandExecutor(@NonNull CLIProcessor.CallingContext callingContext, @NonNull org.apache.commons.cli.CommandLine commandLine) Construct a new command executor.- Parameters:
callingContext
- the context of the command executioncommandLine
- the parsed command line details
-
-
Method Details
-
getCallingContext
Get the context of the command execution, which provides access to the execution environment needed for command processing.- Returns:
- the context
-
getCommandLine
Get the parsed command line details containing the command options and arguments provided by the user during execution.- Returns:
- the cli details
-
execute
Description copied from interface:ICommandExecutor
Execute the command operation.- Specified by:
execute
in interfaceICommandExecutor
- Throws:
CommandExecutionException
- if an error occurred while executing the command operation
-
getCommand
Get the command associated with this execution.- Returns:
- the command
-