|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Options
This class implements basic option parsing. Subclasses add tool-specific
options to the set of options that are accepted. Subclasses are typically
generated using the option generating utility
Main.
| Field Summary | |
private java.lang.String |
name
|
private java.lang.String[] |
nonOptions
The array of non-option arguments. |
private static int |
NOVERSION_CASE
|
private static java.lang.String |
VERSION
|
private boolean |
Xnoversion
|
| Constructor Summary | |
Options(java.lang.String name)
Creates a new Option object. |
|
| Method Summary | |
protected java.lang.String[] |
formOneColumnArray(java.lang.String firstArg)
|
protected java.lang.String[] |
formTwoColumnArray(java.lang.String firstArg,
java.lang.String secondArg)
|
java.util.Hashtable |
getCurrentValue()
Returns the current value |
java.util.Hashtable |
getDefaultValue()
Returns the default value |
java.util.Hashtable |
getGuiType()
Returns the GUI categories that this option is in |
java.util.Hashtable |
getHelpString()
Returns the help messages |
protected int |
getInt(gnu.getopt.Getopt g,
int defaultValue)
|
java.util.LinkedHashSet |
getLongname()
Returns the longname |
gnu.getopt.LongOpt[] |
getLongOptions()
Gets long options |
protected java.lang.String |
getNonNullString(java.lang.String str)
|
protected java.lang.String[][] |
getNonNullStringArray(java.lang.String[][] str)
|
java.util.HashMap |
getOptions()
|
java.util.Hashtable |
getSelectionList()
Returns the list of selections for an option |
java.lang.String |
getShortOptions()
Gets short options |
protected java.lang.String |
getString(gnu.getopt.Getopt g,
java.lang.String defaultValue)
|
protected java.lang.String |
getString(java.lang.String newValue)
|
protected java.lang.String |
getSystemProperty(java.lang.String property)
|
java.util.Hashtable |
getTableHeader()
Returns the header for a table |
java.util.Hashtable |
getType()
Returns the type |
abstract void |
help()
shows an usage message |
java.lang.String[] |
nonOptions()
|
boolean |
parseCommandLine(java.lang.String[] argv)
|
boolean |
parseCommandLine(java.lang.String[] argv,
java.util.ArrayList infiles)
Parses and evaluates the command line arguments. |
void |
printOptions()
Prints the options |
void |
printVersion()
Prints the version information |
boolean |
processOption(int code,
gnu.getopt.Getopt g)
Handles the option identified by the given code,
perhaps using g to process any arguments to the
option. |
boolean |
setOption(java.lang.String name,
java.lang.Object newValue)
|
protected abstract void |
usage()
shows a help message |
protected java.lang.String |
version()
Returns the version information |
boolean |
Xnoversion()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.lang.String[] nonOptions
private final java.lang.String name
private static final java.lang.String VERSION
private boolean Xnoversion
private static final int NOVERSION_CASE
| Constructor Detail |
public Options(java.lang.String name)
name - the command name to pass to getopt| Method Detail |
public boolean parseCommandLine(java.lang.String[] argv)
public boolean parseCommandLine(java.lang.String[] argv,
java.util.ArrayList infiles)
argv - the command line argumentsinfiles - where to put non-option arguments
public boolean setOption(java.lang.String name,
java.lang.Object newValue)
public boolean processOption(int code,
gnu.getopt.Getopt g)
code,
perhaps using g to process any arguments to the
option. This method is typically overridden in subclasses to
process additional arguments with the subclass defering to the
superclass if code is unknown.
g - the command line argumentspublic java.util.HashMap getOptions()
public void printOptions()
public java.util.LinkedHashSet getLongname()
public java.util.Hashtable getTableHeader()
public java.util.Hashtable getType()
public java.util.Hashtable getDefaultValue()
public java.util.Hashtable getCurrentValue()
public java.util.Hashtable getSelectionList()
public java.util.Hashtable getHelpString()
public java.util.Hashtable getGuiType()
public abstract void help()
protected java.lang.String version()
public void printVersion()
protected abstract void usage()
protected int getInt(gnu.getopt.Getopt g,
int defaultValue)
protected java.lang.String getString(gnu.getopt.Getopt g,
java.lang.String defaultValue)
protected java.lang.String getString(java.lang.String newValue)
protected java.lang.String getNonNullString(java.lang.String str)
protected java.lang.String[][] getNonNullStringArray(java.lang.String[][] str)
protected java.lang.String getSystemProperty(java.lang.String property)
protected java.lang.String[] formOneColumnArray(java.lang.String firstArg)
protected java.lang.String[] formTwoColumnArray(java.lang.String firstArg,
java.lang.String secondArg)
public java.lang.String getShortOptions()
public gnu.getopt.LongOpt[] getLongOptions()
public java.lang.String[] nonOptions()
public boolean Xnoversion()
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||