|
mwalk Platform 0.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mwalk.core.Config
A static class that is used to parse the command-line for options and provides some common functionality to all other system components.
If a configuration file is passed in then that file will be read an its contents will be made available to other components through as key/value pairs.
Field Summary | |
protected static java.lang.String |
cfgFile
Configuration file name |
protected static java.util.Properties |
cfgProp
Parsed configuration hash table |
static java.lang.String[] |
dirs
List of directories to check for input files |
static boolean |
gatewayOnly
Whether to allow only gateway traces |
static boolean |
pause
Whether to pause at each node before continuing walk |
static java.lang.String |
readTree
Name of input tree file |
protected static boolean |
skip
Internal parsing flag |
static java.lang.String |
source
Source host or IP address to use in new tree |
static boolean |
verbose
Verbosity flag |
static java.lang.String[] |
visitors
List of visitors to animate with |
static java.lang.String |
writeTree
Name of output tree file |
Constructor Summary | |
protected |
Config()
Default constructor. |
Method Summary | |
static java.lang.String |
getCfg(java.lang.String key)
Lookup a configuration value based on its key. |
static void |
loadCfg(java.lang.String cfgFile)
Load configuration file as a set of key/value pairs. |
static void |
parseArgs(java.lang.String[] args)
Parse the command-line arguments. |
private static boolean |
parseFlag(java.lang.String[] args,
int arg,
char flag)
Parse parameter flags. |
static void |
pause()
Pause and wait for a keystroke if the pause flag is set. |
static void |
pause(java.lang.String prompt)
Pause and wait for a keystroke if the pause flag is set. |
static void |
pause(Visitor visitor)
Pause and wait for a keystroke if the pause flag is set and the visitor is verbose. |
static void |
pause(Visitor visitor,
java.lang.String prompt)
Pause and wait for a keystroke if the pause flag is set and the visitor is verbose. |
static void |
printUsage()
Print usage information. |
static void |
setDirs(java.lang.String dirList)
Parse an array of directories from a comma separated list. |
private static void |
setSkip()
Set the skip flag if the next argument has been used. |
static void |
setVisitors(java.lang.String visitorList)
Parse and array of visitor classes from a comma separated list. |
static void |
verbose(java.lang.Exception debug)
Print if the verbose flag is set. |
static void |
verbose(java.lang.String debug)
Print if the verbose flag is set. |
static void |
verbose(Visitor visitor,
java.lang.String debug)
Print if the visitor is verbose and the verbose flag is set. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static java.lang.String readTree
public static java.lang.String writeTree
public static java.lang.String[] dirs
public static java.lang.String[] visitors
public static java.lang.String source
public static boolean verbose
public static boolean pause
public static boolean gatewayOnly
protected static java.lang.String cfgFile
protected static java.util.Properties cfgProp
protected static boolean skip
Constructor Detail |
protected Config()
Method Detail |
public static void parseArgs(java.lang.String[] args)
String[]
- command-line argumentsprivate static void setSkip()
private static boolean parseFlag(java.lang.String[] args, int arg, char flag)
String[]
- argument listint
- current argumentchar
- current flagboolean
whether the flag was handledpublic static void printUsage()
public static void setDirs(java.lang.String dirList)
String
- list of directoriespublic static void setVisitors(java.lang.String visitorList)
String
- list of visitorspublic static void loadCfg(java.lang.String cfgFile)
String
- complete path to config filepublic static java.lang.String getCfg(java.lang.String key)
String
- config keyString
config valuepublic static void verbose(java.lang.String debug)
String
- text to printpublic static void verbose(Visitor visitor, java.lang.String debug)
Visitor
- visitor to check for verbosityString
- text to printpublic static void verbose(java.lang.Exception debug)
Exception
- exception with text to printpublic static void pause()
public static void pause(java.lang.String prompt)
String
- prompt stringpublic static void pause(Visitor visitor)
Visitor
- visitor to check for verbositypublic static void pause(Visitor visitor, java.lang.String prompt)
Visitor
- visitor to check for verbosityString
- prompt string
|
mwalk Platform 0.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |