类 OptionParsingCommand
- java.lang.Object
- org.springframework.boot.cli.command.AbstractCommand
- org.springframework.boot.cli.command.OptionParsingCommand
- 所有已实现的接口:
Command
- 直接已知子类:
EncodePasswordCommand,GrabCommand,InitCommand,InstallCommand,JarCommand,RunCommand,UninstallCommand,WarCommand
public abstract class OptionParsingCommand extends AbstractCommand
Base class for aCommandthat parse options using anOptionHandler.- 另请参阅:
OptionHandler
构造器概要
构造器 限定符 构造器 说明 protectedOptionParsingCommand(String name, String description, OptionHandler handler)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected OptionHandlergetHandler()StringgetHelp()Gets full help text for the command, e.g. a longer description and one line per option.Collection<OptionHelp>getOptionsHelp()Returns help for each supported option.ExitStatusrun(String... args)Run the command.从类继承的方法 org.springframework.boot.cli.command.AbstractCommand
getDescription, getExamples, getName, getUsageHelp
构造器详细资料
OptionParsingCommand
protected OptionParsingCommand(String name, String description, OptionHandler handler)
方法详细资料
getHelp
public String getHelp()
从接口复制的说明:CommandGets full help text for the command, e.g. a longer description and one line per option.- 指定者:
getHelp在接口中Command- 覆盖:
getHelp在类中AbstractCommand- 返回:
- the command's help text
getOptionsHelp
public Collection<OptionHelp> getOptionsHelp()
从接口复制的说明:CommandReturns help for each supported option.- 指定者:
getOptionsHelp在接口中Command- 覆盖:
getOptionsHelp在类中AbstractCommand- 返回:
- help for each of the command's options
run
public final ExitStatus run(String... args) throws Exception
从接口复制的说明:CommandRun the command.- 参数:
args- command arguments (this will not include the command itself)- 返回:
- the outcome of the command
- 抛出:
Exception- if the command fails
getHandler
protected OptionHandler getHandler()