|
Qizx/open API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.axyana.qizxopen.util.CmdLine
Command line option analyzer.
Options are defined in this object with:
When an option is recognized by the parse method, either a field of a target application object can be set, or a method of this object can be invoked.
| Nested Class Summary | |
static class |
CmdLine.Error
|
| Constructor Summary | |
CmdLine(java.lang.String appName)
Creation with an application name. |
|
| Method Summary | |
void |
define(java.lang.String keyDef,
java.lang.String argLabel,
java.lang.String actionDef,
java.lang.String help)
Defines an option. |
static java.util.Properties |
getDefaultProperties(java.lang.String name)
Loads a property file from the user's home directory. |
void |
parse(java.lang.String[] args,
java.lang.Object appli)
Parses the command line. |
void |
printHelp(java.io.PrintStream out)
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CmdLine(java.lang.String appName)
Options must then be defined by define().
appName - name of the application| Method Detail |
public static java.util.Properties getDefaultProperties(java.lang.String name)
name -
public void define(java.lang.String keyDef,
java.lang.String argLabel,
java.lang.String actionDef,
java.lang.String help)
keyDef - appearance of the option switch.
A null key means a stray argument. The last character defines how an argument of this switch is processed (the argument value can be assigned to a field or passed to a method, according to parameter actionDef):
argLabel - A description of the argument.actionDef - name of a Java field or a method of the application
object. The first character defines the action:help - option help description.
public void parse(java.lang.String[] args,
java.lang.Object appli)
throws java.lang.Exception
Option switches can either set the value of a member of object 'appli', or call a method of this object.
java.lang.Exceptionpublic void printHelp(java.io.PrintStream out)
|
© 2005 Axyana Software | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||