net.dpml.cli

Interface Argument

public interface Argument extends Option

An Option that can process values passed on the command line in the form "--file README".

Version: @PROJECT-VERSION@

Author: @PUBLISHER-NAME@

Method Summary
voiddefaultValues(WriteableCommandLine commandLine, Option option)
Adds defaults to a CommandLine.
chargetInitialSeparator()
Returns the initial separator character or '\0' if no character has been set.
intgetMaximum()
Retrieves the maximum number of values acceptable for a valid Argument
intgetMinimum()
Retrieves the minimum number of values required for a valid Argument
booleanisRequired()
Indicates whether argument values must be present for the CommandLine to be valid.
voidprocessValues(WriteableCommandLine commandLine, ListIterator args, Option option)
Processes the "README" style element of the argument.
voidvalidate(WriteableCommandLine commandLine, Option option)
Performs any necessary validation on the values added to the CommandLine.

Method Detail

defaultValues

public void defaultValues(WriteableCommandLine commandLine, Option option)
Adds defaults to a CommandLine.

Parameters: commandLine the CommandLine object to store defaults in. option the Option to store the defaults against.

getInitialSeparator

public char getInitialSeparator()
Returns the initial separator character or '\0' if no character has been set.

Returns: char the initial separator character

getMaximum

public int getMaximum()
Retrieves the maximum number of values acceptable for a valid Argument

Returns: the maximum number of values

getMinimum

public int getMinimum()
Retrieves the minimum number of values required for a valid Argument

Returns: the minimum number of values

isRequired

public boolean isRequired()
Indicates whether argument values must be present for the CommandLine to be valid.

Returns: true iff the CommandLine will be invalid without at least one value

See Also: getMinimum getMaximum

processValues

public void processValues(WriteableCommandLine commandLine, ListIterator args, Option option)
Processes the "README" style element of the argument. Values identified should be added to the CommandLine object in association with this Argument.

Parameters: commandLine The CommandLine object to store results in. args The arguments to process. option The option to register value against.

Throws: OptionException if any problems occur.

See Also:

validate

public void validate(WriteableCommandLine commandLine, Option option)
Performs any necessary validation on the values added to the CommandLine. Validation will typically involve using the CommandLine.getValues(option) method to retrieve the values and then either checking each value. Optionally the String value can be replaced by another Object such as a Number instance or a File instance.

Parameters: commandLine The CommandLine object to query. option The option to lookup values with.

Throws: OptionException if any problems occur.

See Also: