Class AbstractCommand
- java.lang.Object
- org.springframework.boot.cli.command.AbstractCommand
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
HelpCommand,HintCommand,OptionParsingCommand,PromptCommand,ShellCommand,VersionCommand
public abstract class AbstractCommand extends Object implements Command
AbstractCommandimplementation.
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCommand(String name, String description)Create a newAbstractCommandinstance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescription()Returns a description of the command.Collection<HelpExample>getExamples()Return some examples for the command.StringgetHelp()Gets full help text for the command, e.g.StringgetName()Returns the name of the command.Collection<OptionHelp>getOptionsHelp()Returns help for each supported option.StringgetUsageHelp()Returns usage help for the command.
Constructor Detail
AbstractCommand
protected AbstractCommand(String name, String description)
Create a newAbstractCommandinstance.- Parameters:
name- the name of the commanddescription- the command description
Method Detail
getName
public String getName()
Description copied from interface:CommandReturns the name of the command.
getDescription
public String getDescription()
Description copied from interface:CommandReturns a description of the command.- Specified by:
getDescriptionin interfaceCommand- Returns:
- the command's description
getUsageHelp
public String getUsageHelp()
Description copied from interface:CommandReturns usage help for the command. This should be a simple one-line string describing basic usage. e.g. '[options] <file>'. Do not include the name of the command in this string.- Specified by:
getUsageHelpin interfaceCommand- Returns:
- the command's usage help
getHelp
public String getHelp()
Description copied from interface:CommandGets full help text for the command, e.g. a longer description and one line per option.
getOptionsHelp
public Collection<OptionHelp> getOptionsHelp()
Description copied from interface:CommandReturns help for each supported option.- Specified by:
getOptionsHelpin interfaceCommand- Returns:
- help for each of the command's options
getExamples
public Collection<HelpExample> getExamples()
Description copied from interface:CommandReturn some examples for the command.- Specified by:
getExamplesin interfaceCommand- Returns:
- the command's examples