Package com.aspectran.shell.command
Class AbstractCommand
- java.lang.Object
-
- com.aspectran.shell.command.AbstractCommand
-
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
ClearCommand,HelpCommand,JettyCommand,PauseCommand,PBDecryptCommand,PBEncryptCommand,QuitCommand,RestartCommand,ResumeCommand,SysInfoCommand,TransletCommand,VerboseCommand
public abstract class AbstractCommand extends java.lang.Object implements Command
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.aspectran.shell.command.Command
Command.Descriptor
-
-
Constructor Summary
Constructors Constructor Description AbstractCommand(CommandRegistry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddOption(Option option)CommandRegistrygetCommandRegistry()ConsolegetConsole()OptionsgetOptions()protected OptionParsergetParser()ShellServicegetService()protected ParsedOptionsparse(java.lang.String[] args)voidprintUsage()Prints the usage statement for the specified command.voidprintUsage(Console console)Prints the usage statement for the specified command.-
Methods inherited from interface com.aspectran.shell.command.Command
execute, getDescriptor
-
-
-
-
Field Detail
-
options
protected final Options options
-
-
Constructor Detail
-
AbstractCommand
public AbstractCommand(CommandRegistry registry)
-
-
Method Detail
-
getService
public ShellService getService()
-
getConsole
public Console getConsole()
-
getCommandRegistry
public CommandRegistry getCommandRegistry()
-
getOptions
public Options getOptions()
-
addOption
protected void addOption(Option option)
-
parse
protected ParsedOptions parse(java.lang.String[] args) throws OptionParserException
- Throws:
OptionParserException
-
getParser
protected OptionParser getParser()
-
printUsage
public void printUsage()
Description copied from interface:CommandPrints the usage statement for the specified command.- Specified by:
printUsagein interfaceCommand
-
printUsage
public void printUsage(Console console)
Description copied from interface:CommandPrints the usage statement for the specified command.- Specified by:
printUsagein interfaceCommand- Parameters:
console- the Console instance
-
-