| java.lang.Object net.sourceforge.cruisecontrol.util.MainArgs
MainArgs | final public class MainArgs (Code) | | Methods to perform operations on main() arguments.
|
Field Summary | |
final public static int | NOT_FOUND |
Method Summary | |
public static boolean | argumentPresent(String[] args, String argName) | public static int | findIndex(String[] args, String argName) | public static String | parseArgument(String[] args, String argName, String defaultIfNoParam, String defaultIfNoValue) Searches the array of args for the value corresponding to a particular
argument name. | public static boolean | parseBoolean(String[] args, String argName, boolean defaultIfNoParam, boolean defaultIfNoValue) | public static int | parseInt(String[] args, String argName, int defaultIfNoParam, int defaultIfNoValue) |
NOT_FOUND | final public static int NOT_FOUND(Code) | | |
parseArgument | public static String parseArgument(String[] args, String argName, String defaultIfNoParam, String defaultIfNoValue)(Code) | | Searches the array of args for the value corresponding to a particular
argument name. This method assumes that the argName doesn't include
a "-", but adds one while looking through the array. For example, if a
user is supposed to type "-port", the appropriate argName to supply to
this method is just "port".
This method also allows the specification
of a default argument value, in case one was not specified.
Parameters: args - Application arguments like those specified to the standardJava main function. Parameters: argName - Name of the argument, without any preceeding "-",i.e. "port" not "-port". Parameters: defaultIfNoParam - A default argument value,in case the parameter argName was not specified Parameters: defaultIfNoValue - A default argument value,in case the parameter argName was specified without a value The argument value found, or the default if none was found. |
parseBoolean | public static boolean parseBoolean(String[] args, String argName, boolean defaultIfNoParam, boolean defaultIfNoValue)(Code) | | |
parseInt | public static int parseInt(String[] args, String argName, int defaultIfNoParam, int defaultIfNoValue)(Code) | | |
|
|