See: Description
Class | Description |
---|---|
AOptionComparator |
A comparator for ordering options in a way used for usage messages.
|
CmdLine | Deprecated
Use the CommandLine class instead.
|
CommandLine |
A class providing command line parsing and usage messages using GNU syntax.
|
CommandLineBase |
Base class for running commandline programs.
|
CommandLineTokenStream |
This class preprocesses the command line arguments by splitting them into
several tokens.
|
OptionRegistry |
This class supports collecting options from several objects whose methods
have been annotated with
Option . |
Options |
This class offers a safe and flexible interface to Java properties files.
|
Exception | Description |
---|---|
OptionException |
Base class for exceptions occurring while parsing options.
|
Options.ValueConversionException |
Exception objects of this class are possibly returned by
Options.getBooleanValue(String) and
Options.getIntValue(String) , if corresponding options don't have a
boolean respectively integer value. |
Annotation Type | Description |
---|---|
Option |
Annotation for exposing methods as command line options.
|
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
OptionApplicator
s 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.