Public Member Functions | |
CommandLineOptions () | |
void | addFlag (String flag) |
void | addFlag (String flag, String comment) |
void | addFlag (String flag, String usageText, String comment) |
void | addFlag (String flag, String usageText, String comment, boolean optional) |
Properties | getOptions (String[] args) |
void | setComment (String flag, String comment) |
void | setOptional (String flag, boolean optional) |
void | setUsageInfo (String flag, String usage) |
void | printUsage (PrintWriter pw) |
void | printHelp (PrintWriter pw) |
Package Attributes | |
Vector | flags = null |
Hashtable | optionInfo = null |
PrintWriter | errorWriter = null |
A utility class for generating command line options
org.exolab.castor.util.CommandLineOptions.CommandLineOptions | ( | ) |
void org.exolab.castor.util.CommandLineOptions.addFlag | ( | String | flag | ) |
Adds the flag to list of available command line options
flag | the flag to add as an available command line option |
Referenced by org.exolab.castor.util.CommandLineOptions.addFlag(), org.exolab.castor.builder.SourceGenerator.main(), and org.exolab.castor.tools.MappingTool.main().
void org.exolab.castor.util.CommandLineOptions.addFlag | ( | String | flag, | |
String | comment | |||
) |
Adds the flag to list of available command line options
flag | the flag to add as an available command line option | |
comment | a comment for the flag |
References org.exolab.castor.util.CommandLineOptions.addFlag().
void org.exolab.castor.util.CommandLineOptions.addFlag | ( | String | flag, | |
String | usageText, | |||
String | comment, | |||
boolean | optional | |||
) |
Adds the flag to list of available command line options
flag | the flag to add as an available command line option | |
comment | a comment for the flag | |
usageText | the text that appears after the flag in the usage string | |
optional,when | true, indicates that this flag is optional |
References org.exolab.castor.util.CommandLineOptions.flags, org.exolab.castor.util.CommandLineOptions.optionInfo, org.exolab.castor.util.CmdLineOption.setComment(), org.exolab.castor.util.CmdLineOption.setOptional(), and org.exolab.castor.util.CmdLineOption.setUsageText().
void org.exolab.castor.util.CommandLineOptions.addFlag | ( | String | flag, | |
String | usageText, | |||
String | comment | |||
) |
Adds the flag to list of available command line options
flag | the flag to add as an available command line option | |
comment | a comment for the flag | |
usageText | the text that appears after the flag in the usage string |
References org.exolab.castor.util.CommandLineOptions.addFlag().
Properties org.exolab.castor.util.CommandLineOptions.getOptions | ( | String[] | args | ) |
parses the arguments into a hashtable with the proper flag as the key
References org.exolab.castor.util.CommandLineOptions.errorWriter, org.exolab.castor.util.CommandLineOptions.flags, and org.exolab.castor.util.CommandLineOptions.printUsage().
Referenced by org.exolab.castor.builder.SourceGenerator.main(), and org.exolab.castor.tools.MappingTool.main().
void org.exolab.castor.util.CommandLineOptions.printHelp | ( | PrintWriter | pw | ) |
References org.exolab.castor.util.CommandLineOptions.flags, org.exolab.castor.util.CmdLineOption.getComment(), org.exolab.castor.util.CommandLineOptions.optionInfo, and org.exolab.castor.util.CommandLineOptions.printUsage().
Referenced by org.exolab.castor.builder.SourceGenerator.main(), and org.exolab.castor.tools.MappingTool.main().
void org.exolab.castor.util.CommandLineOptions.printUsage | ( | PrintWriter | pw | ) |
References org.exolab.castor.util.CommandLineOptions.flags, org.exolab.castor.util.CmdLineOption.getOptional(), org.exolab.castor.util.CmdLineOption.getUsageText(), and org.exolab.castor.util.CommandLineOptions.optionInfo.
Referenced by org.exolab.castor.util.CommandLineOptions.getOptions(), org.exolab.castor.builder.SourceGenerator.main(), org.exolab.castor.tools.MappingTool.main(), and org.exolab.castor.util.CommandLineOptions.printHelp().
void org.exolab.castor.util.CommandLineOptions.setComment | ( | String | flag, | |
String | comment | |||
) |
Sets a comment for the flag
flag | the flag to set the comment for | |
comment | the comment to use when printing help for the given flag |
References org.exolab.castor.util.CommandLineOptions.optionInfo, and org.exolab.castor.util.CmdLineOption.setComment().
void org.exolab.castor.util.CommandLineOptions.setOptional | ( | String | flag, | |
boolean | optional | |||
) |
Sets whether or not a given flag is optional
flag | the flag to set optionality for | |
optional | the boolean indicating the optionality for the given flag |
References org.exolab.castor.util.CommandLineOptions.optionInfo, and org.exolab.castor.util.CmdLineOption.setOptional().
void org.exolab.castor.util.CommandLineOptions.setUsageInfo | ( | String | flag, | |
String | usage | |||
) |
Sets the text to print after the flag when printing the usage line
flag | the flag to set the usage info for | |
usage | the usage text |
References org.exolab.castor.util.CommandLineOptions.optionInfo, and org.exolab.castor.util.CmdLineOption.setUsageText().
PrintWriter org.exolab.castor.util.CommandLineOptions.errorWriter = null [package] |
Vector org.exolab.castor.util.CommandLineOptions.flags = null [package] |
Referenced by org.exolab.castor.util.CommandLineOptions.addFlag(), org.exolab.castor.util.CommandLineOptions.CommandLineOptions(), org.exolab.castor.util.CommandLineOptions.getOptions(), org.exolab.castor.util.CommandLineOptions.printHelp(), and org.exolab.castor.util.CommandLineOptions.printUsage().
Hashtable org.exolab.castor.util.CommandLineOptions.optionInfo = null [package] |
Referenced by org.exolab.castor.util.CommandLineOptions.addFlag(), org.exolab.castor.util.CommandLineOptions.CommandLineOptions(), org.exolab.castor.util.CommandLineOptions.printHelp(), org.exolab.castor.util.CommandLineOptions.printUsage(), org.exolab.castor.util.CommandLineOptions.setComment(), org.exolab.castor.util.CommandLineOptions.setOptional(), and org.exolab.castor.util.CommandLineOptions.setUsageInfo().