类 OptionParsingCommand
- java.lang.Object
- org.springframework.boot.cli.command.AbstractCommand
- org.springframework.boot.cli.command.OptionParsingCommand
- 所有已实现的接口:
Command
- 直接已知子类:
GrabCommand
,InitCommand
,InstallCommand
,JarCommand
,RunCommand
,TestCommand
,UninstallCommand
,WarCommand
public abstract class OptionParsingCommand extends AbstractCommand
Base class for aCommand
that parse options using anOptionHandler
.- 另请参阅:
OptionHandler
构造器概要
构造器 限定符 构造器 说明 protected
OptionParsingCommand(String name, String description, OptionHandler handler)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected OptionHandler
getHandler()
String
getHelp()
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.ExitStatus
run(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()
从接口复制的说明:Command
Gets 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()
从接口复制的说明:Command
Returns 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
从接口复制的说明:Command
Run 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()