public class ConfigOptionParser
extends java.lang.Object
Constructor and Description |
---|
ConfigOptionParser() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
generate(java.util.List<ConfigOption> configList,
java.lang.String... args)
Parses the configuration list and tries to create a mapping of the corresponding objects from the command line, properties
or environment variables
As long as the
StringConverter are implemented with a null as fail
and a working conversion the mapped objects are always in a correct state and castable to their representation |
static ReportGenerator.Format |
getFormat(java.lang.String... args)
Terminates with a help message if the parse is not successful
|
java.lang.Object |
getValue(ConfigOption co) |
void |
printUsageAndExit(java.util.List<ConfigOption> configOptions)
Creates a help message based on the descriptions of the
ConfigOption and terminates |
public java.lang.Object getValue(ConfigOption co)
co
- the configuration option to search forpublic java.util.Map<java.lang.String,java.lang.Object> generate(java.util.List<ConfigOption> configList, java.lang.String... args)
StringConverter
are implemented with a null as fail
and a working conversion the mapped objects are always in a correct state and castable to their representationconfigList
- the configuration list by which to search for the objectsargs
- command line argumentspublic static ReportGenerator.Format getFormat(java.lang.String... args)
args
- command line arguments topublic void printUsageAndExit(java.util.List<ConfigOption> configOptions)
ConfigOption
and terminatesconfigOptions
- the configuration options of the report