|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.symbian.et.test.cmdline.CmdLine
modelizes the syntax of a command
| Field Summary | |
private AnyData |
iAnyDataChecker
|
private CmdOperational |
iCmdOperation
|
private CmdLineSet |
iCmdSet
|
private java.lang.String |
iCommand
|
private org.apache.commons.cli.CommandLine |
iCommandLine
|
private java.lang.String |
iDescription
|
private org.apache.commons.cli.HelpFormatter |
iFormatter
|
private org.apache.commons.cli.Options |
iOptions
|
private java.util.ArrayList |
iParametersChecks
|
private java.util.ArrayList |
iParametersToCheck
|
| Constructor Summary | |
CmdLine(java.lang.String aCommand,
CmdOperational aCmdOperation,
java.lang.String aDescription)
standard constructor |
|
| Method Summary | |
void |
addSwitch(java.lang.String aSwitchName,
boolean aIsSingle,
java.lang.String aDescription,
boolean aIsMandatory,
boolean aHasArgs)
adds a switch to a command |
void |
addSwitch(java.lang.String aSwitchName,
boolean aIsSingle,
java.lang.String aDescription,
boolean aIsMandatory,
DataAcceptable aDataCheck)
adds a switch to a command |
void |
checkAdditionalConstraints(org.apache.commons.cli.CommandLine aCommandLine)
checks additional constraints method only useful if overridden by specialized classes this is the method to be overriden if one wants to specify specific forbidden switch combinations |
void |
checkConstraints(org.apache.commons.cli.CommandLine aCommandLine)
parses a command to check its validity |
CmdLine |
find(java.lang.String aSoughtCommand)
finds a particular command in the associated command set, given a command name |
org.apache.commons.cli.CommandLine |
getCommandLine()
retrieves the org.apache.commons.cli.CommandLine object that parses the command lineuse this to customize the command line |
org.apache.commons.cli.Options |
getOptions()
|
boolean |
isCommand(java.lang.String aCommand)
determines if a particular command name matches the command |
void |
printAllCmds()
displays the name of all the commands |
void |
printCommand()
displays command name |
void |
printCopyright()
prints tool copyright |
void |
printDescription()
prints description of the particular command |
void |
printHelp()
displays help |
void |
printPurpose()
displays command purpose |
void |
printToolName()
displays tool name |
void |
printToolVersion()
displays tool version |
protected void |
setCmdSet(CmdLineSet aCmdSet)
associates to a command set |
java.lang.Object |
start(org.apache.commons.cli.CommandLine aCmdLine)
starts command |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.lang.String iCommand
private CmdOperational iCmdOperation
private java.lang.String iDescription
private CmdLineSet iCmdSet
private org.apache.commons.cli.Options iOptions
private org.apache.commons.cli.HelpFormatter iFormatter
private org.apache.commons.cli.CommandLine iCommandLine
private java.util.ArrayList iParametersToCheck
private java.util.ArrayList iParametersChecks
private AnyData iAnyDataChecker
| Constructor Detail |
public CmdLine(java.lang.String aCommand,
CmdOperational aCmdOperation,
java.lang.String aDescription)
aCommand - name of the commandaCmdOperation - object that implements commandaDescription - brief description of the command (used by help command)| Method Detail |
public org.apache.commons.cli.CommandLine getCommandLine()
throws CmdLineException
org.apache.commons.cli.CommandLine object that parses the command line
CmdLineExceptionprotected void setCmdSet(CmdLineSet aCmdSet)
aCmdSet - command setpublic final boolean isCommand(java.lang.String aCommand)
aCommand - command name
public void addSwitch(java.lang.String aSwitchName,
boolean aIsSingle,
java.lang.String aDescription,
boolean aIsMandatory,
boolean aHasArgs)
aSwitchName - name of the switch //TODO: single = doubleaDescription - description of the switch (for help command)aIsMandatory - make switch mandatoryaHasArgs - make switch arguments possible //TODO: is it 'mandatory' or 'possible'
public void addSwitch(java.lang.String aSwitchName,
boolean aIsSingle,
java.lang.String aDescription,
boolean aIsMandatory,
DataAcceptable aDataCheck)
aSwitchName - name of the switch //TODO: single = doubleaDescription - description of the switch (for help command)aIsMandatory - make switch mandatoryaDataCheck - facility to check the validity of the parameter
public final void checkConstraints(org.apache.commons.cli.CommandLine aCommandLine)
throws org.apache.commons.cli.ParseException
aCommandLine - org.apache.commons.cli.CommandLine object
org.apache.commons.cli.ParseException - if the command provided is not syntaxically correct
public void checkAdditionalConstraints(org.apache.commons.cli.CommandLine aCommandLine)
throws org.apache.commons.cli.ParseException
aCommandLine -
org.apache.commons.cli.ParseExceptionpublic void printHelp()
public void printDescription()
public void printPurpose()
public final org.apache.commons.cli.Options getOptions()
public final java.lang.Object start(org.apache.commons.cli.CommandLine aCmdLine)
throws CmdLineException
CmdNotInitializedException
CmdLineExceptionpublic void printCommand()
public void printToolVersion()
throws CmdLineException
CmdParsingFailureException - if command is not linked to any command set
CmdLineException
public void printToolName()
throws CmdLineException
CmdParsingFailureException - if command is not linked to any command set
CmdLineExceptionpublic void printAllCmds()
public CmdLine find(java.lang.String aSoughtCommand)
aSoughtCommand -
public void printCopyright()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||