Table of Contents
Default program behavior can be configured in one or more files that
the command line merely overrides.
JSAP provides a
registerDefaultSource(DefaultSource) method to
support this. At the time of this writing, the only concrete
PropertyDefaultSource, which reads files in
DefaultSources may be registered
JSAP. When a default value is sought, the
DefaultSources are checked in the order in which
they were registered. The first default value encountered by
JSAP is used.
PropertyDefaultSource reads default values
from text files consisting of zero or more lines of
"key=value"-type assignments. Property names may be parameter
IDs, long flags, or short flags for the parameters they address.
JSAP interprets them in that order (ID, then long
flag, then short flag).
When you create a
you can tell it not to throw
allows you to specify a number of possible locations for files that
don't have to exist.
A typical order in which to register
the user's home directory (obtained via
on *nix systems
if your program makes use of an environment variable to point to its
If you have any suggestions for a search order example for Windows or Mac, please let me know.
PropertyDefaultSource has not yet been
QualifiedSwitches; odds are it
won't work as you expect.