|
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 String |
name
|
private String[] |
nonOptions
The array of non-option arguments. |
private static int |
NOVERSION_CASE
|
private static String |
VERSION
|
private boolean |
Xnoversion
|
| Constructor Summary | |
Options(String name)
Creates a new Option object. |
|
| Method Summary | |
protected String[] |
formOneColumnArray(String firstArg)
|
protected String[] |
formTwoColumnArray(String firstArg,
String secondArg)
|
Hashtable |
getCurrentValue()
Returns the current value |
Hashtable |
getDefaultValue()
Returns the default value |
Hashtable |
getGuiType()
Returns the GUI categories that this option is in |
Hashtable |
getHelpString()
Returns the help messages |
protected int |
getInt(gnu.getopt.Getopt g,
int defaultValue)
|
LinkedHashSet |
getLongname()
Returns the longname |
gnu.getopt.LongOpt[] |
getLongOptions()
Gets long options |
protected String |
getNonNullString(String str)
|
protected String[][] |
getNonNullStringArray(String[][] str)
|
HashMap |
getOptions()
|
Hashtable |
getSelectionList()
Returns the list of selections for an option |
String |
getShortOptions()
Gets short options |
protected String |
getString(gnu.getopt.Getopt g,
String defaultValue)
|
protected String |
getString(String newValue)
|
protected String |
getSystemProperty(String property)
|
Hashtable |
getTableHeader()
Returns the header for a table |
Hashtable |
getType()
Returns the type |
abstract void |
help()
shows an usage message |
String[] |
nonOptions()
|
boolean |
parseCommandLine(String[] argv)
|
boolean |
parseCommandLine(String[] argv,
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(String name,
Object newValue)
|
protected abstract void |
usage()
shows a help message |
protected 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 String[] nonOptions
private final String name
private static final String VERSION
private boolean Xnoversion
private static final int NOVERSION_CASE
| Constructor Detail |
public Options(String name)
name - the command name to pass to getopt| Method Detail |
public boolean parseCommandLine(String[] argv)
public boolean parseCommandLine(String[] argv,
ArrayList infiles)
argv - the command line argumentsinfiles - where to put non-option arguments
public boolean setOption(String name,
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 HashMap getOptions()
public void printOptions()
public LinkedHashSet getLongname()
public Hashtable getTableHeader()
public Hashtable getType()
public Hashtable getDefaultValue()
public Hashtable getCurrentValue()
public Hashtable getSelectionList()
public Hashtable getHelpString()
public Hashtable getGuiType()
public abstract void help()
protected String version()
public void printVersion()
protected abstract void usage()
protected int getInt(gnu.getopt.Getopt g,
int defaultValue)
protected String getString(gnu.getopt.Getopt g,
String defaultValue)
protected String getString(String newValue)
protected String getNonNullString(String str)
protected String[][] getNonNullStringArray(String[][] str)
protected String getSystemProperty(String property)
protected String[] formOneColumnArray(String firstArg)
protected String[] formTwoColumnArray(String firstArg,
String secondArg)
public String getShortOptions()
public gnu.getopt.LongOpt[] getLongOptions()
public String[] nonOptions()
public boolean Xnoversion()
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||