Skip navigation links

Package org.conqat.lib.commons.options

Classes for simplifying command line parsing.

See: Description

Package org.conqat.lib.commons.options Description

Classes for simplifying command line parsing. The general idea is to annotate methods with org.conqat.lib.commons.options.AOption, which are then exposed as command line switches. Whether the option takes an argument (and the type of the argument) is determined by the arguments the method accepts. Additional constraints on the option arguments (e.g. value positive) can be enforced by the method by throwing an IllegalArgumentException.

The options are extracted and collected by an OptionRegistry. The OptionRegistry extracts methods annotated with AOption and keeps them as OptionApplicators for later use. To support the distribution of option handling over multiple classes (e.g. to separate options affecting different parts of the architecture) multiple objects can be registered with the registry.

The actual parsing of the command line is performed by the CommandLine. This is to separate the low level part (annotations and reflection) from the parser. Additionally this way the parser can easily be extended or exchanged.

As an example for using these classes see the org.conqat.engine.core.driver.Driver class in the ConQAT project.

Skip navigation links