|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectio.args.ArgumentParser
| Field Summary | |
java.util.HashMap |
available
|
java.util.HashMap |
definitions
|
java.lang.String |
helpText
|
java.lang.String |
progname
|
| Constructor Summary | |
ArgumentParser()
|
|
| Method Summary | |
protected void |
checkHelp(java.util.HashMap av)
if the arguments contain the help keyword, print a usage text and exit. |
private java.util.HashMap |
checkInputFile(java.util.HashMap av)
if the arguments contain the f keyword, read the corresponding input file. |
protected void |
checkValues()
assert that all the supplied arguments conform to the argument value definitions. |
protected java.util.HashMap |
compareArgs(java.util.HashMap availableArgs)
compare the supplied arguments with the defined arguments |
private java.util.HashMap |
getArgs(java.lang.String[] argv)
read the argument data from various sources (argument vector, or file). |
java.util.HashMap |
parse(java.lang.String[] argv)
parses an array of strings, doing cross checks against defined arguments and defined argument values. |
void |
put(ArgumentDescription a)
Add another argument description |
static java.util.ArrayList |
readinputfile(java.lang.String file)
slurp contents of an input file, stripping comments |
java.lang.String |
usage()
supply a usage string detailing program name, program usage and defined arguments. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public java.lang.String progname
public java.lang.String helpText
public java.util.HashMap definitions
public java.util.HashMap available
| Constructor Detail |
public ArgumentParser()
| Method Detail |
public java.util.HashMap parse(java.lang.String[] argv)
argv -
public void put(ArgumentDescription a)
throws java.io.IOException
a - ArgumentDescription
java.io.IOExceptionpublic java.lang.String usage()
private java.util.HashMap getArgs(java.lang.String[] argv)
throws java.io.IOException
argv -
java.io.IOException
private java.util.HashMap checkInputFile(java.util.HashMap av)
throws java.io.IOException
av -
java.io.IOException
public static java.util.ArrayList readinputfile(java.lang.String file)
throws java.io.IOException
file -
java.io.IOException
protected void checkHelp(java.util.HashMap av)
throws java.io.IOException
av -
java.io.IOException
protected java.util.HashMap compareArgs(java.util.HashMap availableArgs)
throws java.io.IOException
availableArgs -
java.io.IOException
protected void checkValues()
throws java.io.IOException
java.io.IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||