|
SigPath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mssm.crover.cli.CLI
public final class CLI
Provides general services needed by Command Line Interface programs. These services include: configuration of the environment through a property file, methods to parse options from the command line.
| Method Summary | |
|---|---|
boolean |
fileExists(String filename)
Deprecated. |
static double |
getDoubleOption(String[] args,
String option,
double defaultValue)
Deprecated. Extracts a double parameter from the command line arguments. |
static float |
getFloatOption(String[] args,
String option,
float defaultValue)
Deprecated. Extracts a float parameter from the command line arguments. |
static CLI |
getInstance()
Deprecated. Returns the singleton instance of CLI. |
String |
getInstanceProperty(String propertyName)
Deprecated. Returns the value of a property. |
static int |
getIntOption(String[] args,
String option,
int defaultValue)
Deprecated. Extracts an integer parameter from the command line arguments. |
static long |
getLongOption(String[] args,
String option,
long defaultValue)
Deprecated. Extracts a long parameter from the command line arguments. |
static String |
getOption(String[] args,
String option,
String defaultValue)
Deprecated. Extracts an option parameter from the command line arguments. |
static String[] |
getOptions(String[] args,
String keyword)
Deprecated. Returns an array of all the options given for a given keyword. |
static String[] |
getOptions(String[] args,
String keyword,
String[] defaultValue)
Deprecated. Returns an array of all the options given for a given keyword. |
static String[] |
getOrderedOptions(String[] args,
String keyword)
Deprecated. Returns an array of all the options given for a given keyword in the order the are given on the command line. |
static String |
getProperty(String propertyName)
Deprecated. Returns the value of a property. |
static String |
getProperty(String propertyName,
String defaultValue)
Deprecated. Returns the value of a property. |
static String[] |
getTwoPartOptions(String[] args,
String keyword)
Deprecated. Returns an array of all the options given for a given keyword. |
static boolean |
isKeywordGiven(String[] args,
String keyword)
Deprecated. Extracts a boolean keyword from the command line arguments. |
static boolean |
isKeywordGiven(String[] args,
String keyword,
boolean defaultValue)
Deprecated. Extracts a boolean keyword from the command line arguments. |
void |
loadProperties()
Deprecated. |
static String[] |
printOptions(String[] args,
org.apache.commons.logging.Log log)
Deprecated. |
static String[] |
printOptions(String[] args,
PrintStream out)
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static CLI getInstance()
public void loadProperties()
public boolean fileExists(String filename)
public String getInstanceProperty(String propertyName)
public static String getProperty(String propertyName)
public static String getProperty(String propertyName,
String defaultValue)
defaultValue - The value to be returned when the property is
not defined.
public static String getOption(String[] args,
String option,
String defaultValue)
args - The command line arguments.option - the name of the parameter (name value pairs are assumed)defaultValue - The value that is returned when the
keyword is not found on the command line.
public static boolean isKeywordGiven(String[] args,
String keyword,
boolean defaultValue)
args - The command line arguments.keyword - the name of the optional keyword.defaultValue - The value that is returned when the
keyword is not found on the command line.
public static boolean isKeywordGiven(String[] args,
String keyword)
args - The command line arguments.keyword - the name of the optional keyword.
public static long getLongOption(String[] args,
String option,
long defaultValue)
args - The command line arguments.option - the name of the parameter (name value pairs are assumed)defaultValue - The value that is returned when the
keyword is not found on the command line.
public static int getIntOption(String[] args,
String option,
int defaultValue)
args - The command line arguments.option - the name of the parameter (name value pairs are assumed)defaultValue - The value that is returned when the
keyword is not found on the command line.
public static double getDoubleOption(String[] args,
String option,
double defaultValue)
args - The command line arguments.option - the name of the parameter (name value pairs are assumed)defaultValue - The value that is returned when the
keyword is not found on the command line.
public static float getFloatOption(String[] args,
String option,
float defaultValue)
args - The command line arguments.option - the name of the parameter (name value pairs are assumed)defaultValue - The value that is returned when the
keyword is not found on the command line.
public static String[] getOptions(String[] args,
String keyword)
args - The command line arguments.keyword -
public static String[] getOrderedOptions(String[] args,
String keyword)
args - The command line arguments.keyword -
public static String[] getTwoPartOptions(String[] args,
String keyword)
args - The command line arguments.keyword -
public static String[] getOptions(String[] args,
String keyword,
String[] defaultValue)
public static String[] printOptions(String[] args,
PrintStream out)
public static String[] printOptions(String[] args,
org.apache.commons.logging.Log log)
|
SigPath | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||