Package de.hsh.graja.util.cli
Class CommandProvider
java.lang.Object
de.hsh.graja.util.cli.CommandProvider
- All Implemented Interfaces:
Comparable<CommandProvider>
- Direct Known Subclasses:
AsgmtBuilderCommandProvider
,BackendCommandProvider
,GuiCommandProvider
,StarterCommandProvider
,TransformCommandProvider
,VariabilityCommandProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
abstract void
This is themain
method of a command.protected String
getAdditionalAddModulesOption
(String command) For usage printout this method should return a comma-separated list of modules that need to be added on the command line to get thecommand
running.protected String
For usage printout this method should return a path-delimiter-separated list of module paths that need to be added on the --module-path command line option to get thecommand
running.protected String
For usage printout this method should return a path-delimiter-separated list of module paths that need to be added on the --module-path command line option to get thecommand
running.protected abstract String[]
getCommands
(Logging log) getName()
int
hashCode()
provideCommands
(Logging log, JsonMarshaller marshaller, CliConfig cfg) protected void
validateCommand
(Logging log, String commandString)
-
Constructor Details
-
CommandProvider
public CommandProvider()
-
-
Method Details
-
getCommands
-
getAdditionalAddModulesOption
For usage printout this method should return a comma-separated list of modules that need to be added on the command line to get thecommand
running.- Parameters:
command
-- Returns:
- Default: ""
-
getAdditionalModulePathOptionTemplate
For usage printout this method should return a path-delimiter-separated list of module paths that need to be added on the --module-path command line option to get thecommand
running.- Parameters:
command
-- Returns:
- Default: ""
-
getAdditionalModulePathOptionExample
For usage printout this method should return a path-delimiter-separated list of module paths that need to be added on the --module-path command line option to get thecommand
running.- Parameters:
command
-- Returns:
- Default: ""
-
executeCommand
public abstract void executeCommand(Logging log, String command, TreeMap<String, Object> options) throws CommandExceptionThis is themain
method of a command. It is called byCommand.execute(Logging, String[])
.- Parameters:
log
- All output should go to this Logging instancecommand
-options
-- Throws:
Exception
- this signals an error, that usually a caller will react to by exiting the JVM return a value different from 0.CommandException
-
getName
-
provideCommands
public List<Command> provideCommands(Logging log, JsonMarshaller marshaller, CliConfig cfg) throws Exception - Throws:
Exception
-
validateCommand
- Throws:
IllegalArgumentException
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<CommandProvider>
-