Chapter 2. Vocabulary

Before continuing, some explanation of the vocabulary used in this manual is required:

Argument

A single (String) token from the command line. The JVM will provide an array of these to your main() method.

Parameter

One or more arguments that must be taken together to have meaning. For example, in the command "java -cp myjar.jar MyClass", the arguments "-cp" and "myjar.jar" comprise a single parameter defining the classpath. The argument "MyClass" comprises another parameter indicating the class to load and run.

Switch

A single-argument parameter whose presence alone conveys meaning. For example, in the command "java -version", the "-version" switch tells the JVM to print its version information and exit.

Option

A parameter whose content conveys meaning. In the command "java -cp myjar.jar MyClass", the "-cp myjar.jar" parameter is an option, as is the "MyClass" parameter.

Flagged Option

An option that is preceded by a "flag" to indicate which option is being set. In the command "java -cp myjar.jar MyClass", the "-cp myjar.jar" option is flagged by "-cp".

Unflagged Option

An option that is not preceded by a flag, and whose meaning is conveyed by its position in the command line relative to other Unflagged Options. In the command "java -cp myjar.jar MyClass", "MyClass" is an unflagged option.

QualifiedSwitch

A combination of Switch and FlaggedOption. It serves the same function as a Switch on a command line, but it may be "qualified" with additional data following a colon. In the commands "java -verbose MyClass" and "java -verbose:class MyClass", "verbose" is a QualifiedSwitch qualified by the "class" qualifier in the second example.

Short Flag

A single-character flag preceded by a single dash.

Long Flag

A multi-character flag preceded by a double dash.

ID

A unique identifier assigned by the programmer to each parameter JSAP should recognize. A parameter's ID is seen only by the programmer, and is used to retrieve its values from the JSAPResult object.