|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CommandLineModule
All command line modules must implement this interface in order to extend msInspect commandline functionality. The flow is as follows: -Application finds all CommandLineModule-implementing classes within a specified list of packages -For each such class, it calls getCommandName() to determine the command that should be used to invoke the module. It creates an instance of the module using the no-arg constructor -If the user enters this command, getArgumentDefinitions() is called to find out what arguments are allowed -The user's arguments are parsed. If they all pass basic validation, assignArgumentValues() is called -If assignArgumentValues() succeeds, execute() is called Although it is not required, we recommend that CommandLineModule classes extend BaseCommandLineModuleImpl, which provides some convenience method implementations.
| Field Summary | |
|---|---|
static java.lang.String |
MODULE_HELP_AUTOMATIC
|
static java.lang.String |
MODULE_USAGE_AUTOMATIC
|
static java.lang.String |
UNNAMED_ARG_SERIES_SEPARATOR
|
| Method Summary | |
|---|---|
void |
assignArgumentValues()
the first step in invoking your module. |
void |
digestArguments(java.util.Map<java.lang.String,java.lang.String> argumentValueMap)
|
void |
execute()
Called by msInspect after assignArgumentValues. |
CommandLineArgumentDefinition[] |
getAdvancedArgumentDefinitions()
|
CommandLineArgumentDefinition |
getArgumentDefinition(java.lang.String argumentName)
|
CommandLineArgumentDefinition[] |
getArgumentDefinitions()
|
CommandLineArgumentDefinition[] |
getArgumentDefinitionsSortedForDisplay()
|
java.util.Map<java.lang.String,java.lang.String> |
getArgumentValueStrings()
Return the original argument name-value pairs that were passed into this module via digestArguments() |
CommandLineArgumentDefinition[] |
getBasicArgumentDefinitions()
|
java.lang.String |
getCommandName()
|
java.lang.String |
getFullHelp()
Returns the full help message to be displayed by --help |
java.lang.String |
getHelpMessage()
a String giving the user detailed help on invoking this command |
java.lang.String |
getHtmlHelpFragment()
Returns an HTML fragment containing full help information for this module |
java.lang.String |
getShortDescription()
|
java.lang.String |
getUsage()
|
void |
invoke(java.util.Map<java.lang.String,java.lang.String> argumentValues)
Invoke the CommandLineModule, using the argument values specified in the argumentValues array. |
| Field Detail |
|---|
static final java.lang.String MODULE_USAGE_AUTOMATIC
static final java.lang.String MODULE_HELP_AUTOMATIC
static final java.lang.String UNNAMED_ARG_SERIES_SEPARATOR
| Method Detail |
|---|
java.lang.String getUsage()
java.lang.String getHelpMessage()
java.lang.String getFullHelp()
java.lang.String getHtmlHelpFragment()
java.lang.String getCommandName()
java.lang.String getShortDescription()
CommandLineArgumentDefinition[] getArgumentDefinitions()
CommandLineArgumentDefinition[] getBasicArgumentDefinitions()
CommandLineArgumentDefinition[] getAdvancedArgumentDefinitions()
CommandLineArgumentDefinition[] getArgumentDefinitionsSortedForDisplay()
CommandLineArgumentDefinition getArgumentDefinition(java.lang.String argumentName)
void digestArguments(java.util.Map<java.lang.String,java.lang.String> argumentValueMap)
throws ArgumentValidationException
argumentValueMap -
ArgumentValidationExceptionjava.util.Map<java.lang.String,java.lang.String> getArgumentValueStrings()
void assignArgumentValues()
throws ArgumentValidationException
ArgumentValidationException
void execute()
throws CommandLineModuleExecutionException
CommandLineModuleExecutionException
void invoke(java.util.Map<java.lang.String,java.lang.String> argumentValues)
throws ArgumentValidationException,
CommandLineModuleExecutionException
argumentValues -
ArgumentValidationException
CommandLineModuleExecutionException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||