Class AbstractCommand
java.lang.Object
org.springframework.shell.core.command.AbstractCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
ConsumerCommandAdapter,FunctionCommandAdapter,MethodInvokerCommandAdapter
Base class helping to build shell commands.
- Author:
- Janne Valkealahti, Piotr Olaszewski, Mahmoud Ben Hassine
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.shell.core.command.Command
Command.Builder -
Constructor Summary
ConstructorsConstructorDescriptionAbstractCommand(String name, String description) AbstractCommand(String name, String description, String group) AbstractCommand(String name, String description, String group, String help, boolean hidden) -
Method Summary
Modifier and TypeMethodDescriptionabstract ExitStatusdoExecute(CommandContext commandContext) booleanexecute(CommandContext commandContext) Execute the command within the given context.Get the aliases of the command.Get the availability provider of the command.Get the completion provider of the command.Get a short description of the command.@Nullable ExitStatusExceptionMappergetGroup()Get the group of the command.getHelp()Get the help text of the command.getName()Get the name of the command.Get the options of the command.inthashCode()protected booleanisHelp(CommandOption option) booleanisHidden()Check if the command is hidden.protected voidprintln(String message, CommandContext commandContext) voidsetAliases(List<String> aliases) voidsetAvailabilityProvider(AvailabilityProvider availabilityProvider) voidsetCompletionProvider(CompletionProvider completionProvider) voidsetExitStatusExceptionMapper(ExitStatusExceptionMapper exitStatusExceptionMapper) voidsetOptions(List<CommandOption> options)
-
Constructor Details
-
AbstractCommand
-
AbstractCommand
-
AbstractCommand
-
-
Method Details
-
getName
Description copied from interface:CommandGet the name of the command. -
getGroup
Description copied from interface:CommandGet the group of the command. -
getDescription
Description copied from interface:CommandGet a short description of the command.- Specified by:
getDescriptionin interfaceCommand- Returns:
- the description of the command
-
getHelp
Description copied from interface:CommandGet the help text of the command. -
isHidden
public boolean isHidden()Description copied from interface:CommandCheck if the command is hidden. -
getAliases
Description copied from interface:CommandGet the aliases of the command.- Specified by:
getAliasesin interfaceCommand- Returns:
- the aliases of the command
-
setAliases
-
getOptions
Description copied from interface:CommandGet the options of the command.- Specified by:
getOptionsin interfaceCommand- Returns:
- the options of the command
-
setOptions
-
getAvailabilityProvider
Description copied from interface:CommandGet the availability provider of the command. Defaults to always available.- Specified by:
getAvailabilityProviderin interfaceCommand- Returns:
- the availability provider of the command
-
setAvailabilityProvider
-
getExitStatusExceptionMapper
-
setExitStatusExceptionMapper
-
getCompletionProvider
Description copied from interface:CommandGet the completion provider of the command.- Specified by:
getCompletionProviderin interfaceCommand- Returns:
- the completion provider of the command
-
setCompletionProvider
-
execute
Description copied from interface:CommandExecute the command within the given context. -
println
-
isHelp
-
doExecute
- Throws:
Exception
-
equals
-
hashCode
public int hashCode()
-