net.dpml.cli

Interface WriteableCommandLine

public interface WriteableCommandLine extends CommandLine

A CommandLine that detected values and options can be written to.
Method Summary
voidaddOption(Option option)
Adds an Option to the CommandLine
voidaddProperty(String property, String value)
Adds a property value to a name in the CommandLine.
voidaddSwitch(Option option, boolean value)
Adds a switch value to an Option in the CommandLine.
voidaddValue(Option option, Object value)
Adds a value to an Option in the CommandLine.
booleanlooksLikeOption(String argument)
Detects whether the argument looks like an Option trigger
voidsetDefaultSwitch(Option option, Boolean defaultSwitch)
Sets the default state for a Switch in the CommandLine.
voidsetDefaultValues(Option option, List defaultValues)
Sets the default values for an Option in the CommandLine

Method Detail

addOption

public void addOption(Option option)
Adds an Option to the CommandLine

Parameters: option the Option to add

addProperty

public void addProperty(String property, String value)
Adds a property value to a name in the CommandLine. Replaces any existing value for the property.

Parameters: property the name of the property value the value of the property

addSwitch

public void addSwitch(Option option, boolean value)
Adds a switch value to an Option in the CommandLine.

Parameters: option the Option to add to value the switch value to add

Throws: IllegalStateException if the switch has already been added

addValue

public void addValue(Option option, Object value)
Adds a value to an Option in the CommandLine.

Parameters: option the Option to add to value the value to add

looksLikeOption

public boolean looksLikeOption(String argument)
Detects whether the argument looks like an Option trigger

Parameters: argument the argument to test

Returns: true if the argument looks like an Option trigger

setDefaultSwitch

public void setDefaultSwitch(Option option, Boolean defaultSwitch)
Sets the default state for a Switch in the CommandLine.

Parameters: option the Option to add to defaultSwitch the defaults state for ths switch

setDefaultValues

public void setDefaultValues(Option option, List defaultValues)
Sets the default values for an Option in the CommandLine

Parameters: option the Option to add to defaultValues the defaults for the option