Package com.tngtech.jgiven.report.config
Class ConfigOptionParser
java.lang.Object
com.tngtech.jgiven.report.config.ConfigOptionParser
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongenerate
(List<ConfigOption> configList, 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 theStringConverter
are implemented with a null as fail and a working conversion the mapped objects are always in a correct state and castable to their representationstatic ReportGenerator.Format
Terminates with a help message if the parse is not successfulgetValue
(ConfigOption co) void
printUsageAndExit
(List<ConfigOption> configOptions) Creates a help message based on the descriptions of theConfigOption
and terminates
-
Constructor Details
-
ConfigOptionParser
public ConfigOptionParser()
-
-
Method Details
-
getValue
- Parameters:
co
- the configuration option to search for- Returns:
- returns a castable object
-
generate
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 theStringConverter
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- Parameters:
configList
- the configuration list by which to search for the objectsargs
- command line arguments- Returns:
- returns the map of config.longName keys and corresponding castable objects
-
getFormat
Terminates with a help message if the parse is not successful- Parameters:
args
- command line arguments to- Returns:
- the format in a correct state
-
printUsageAndExit
Creates a help message based on the descriptions of theConfigOption
and terminates- Parameters:
configOptions
- the configuration options of the report
-