| java.lang.Object com.jeantessier.commandline.CommandLine
CommandLine | public class CommandLine implements Visitable(Code) | | Command-line parser.
|
Method Summary | |
public void | accept(Visitor visitor) | public AliasSwitch | addAliasSwitch(String name, String... switchNames) Returns an
AliasSwitch mapping name to switchNames.
Parameters: name - the name of the new alias. Parameters: switchNames - the switches that the alias maps to. | public MultipleValuesSwitch | addMultipleValuesSwitch(String name) | public MultipleValuesSwitch | addMultipleValuesSwitch(String name, boolean mandatory) | public MultipleValuesSwitch | addMultipleValuesSwitch(String name, String defaultValue) | public MultipleValuesSwitch | addMultipleValuesSwitch(String name, String defaultValue, boolean mandatory) | public OptionalValueSwitch | addOptionalValueSwitch(String name) | public OptionalValueSwitch | addOptionalValueSwitch(String name, boolean mandatory) | public OptionalValueSwitch | addOptionalValueSwitch(String name, String defaultValue) | public OptionalValueSwitch | addOptionalValueSwitch(String name, String defaultValue, boolean mandatory) | public SingleValueSwitch | addSingleValueSwitch(String name) | public SingleValueSwitch | addSingleValueSwitch(String name, boolean mandatory) | public SingleValueSwitch | addSingleValueSwitch(String name, String defaultValue) | public SingleValueSwitch | addSingleValueSwitch(String name, String defaultValue, boolean mandatory) | public ToggleSwitch | addToggleSwitch(String name) | public ToggleSwitch | addToggleSwitch(String name, boolean defaultValue) | public Set<String> | getKnownSwitches() | public List<String> | getMultipleSwitch(String name) | public String | getOptionalSwitch(String name) | public ParameterStrategy | getParameterStrategy() | public List<String> | getParameters() | public Set<String> | getPresentSwitches() | public String | getSingleSwitch(String name) | public CommandLineSwitch | getSwitch(String name) Returns a
CommandLineSwitch matching name, if any.
Parameters: name - the name of the switch to lookup. | public CommandLineSwitch | getSwitch(String name, boolean strict) Returns a
CommandLineSwitch matching name, if any.
Parameters: name - the name of the CommandLineSwitch to lookup. Parameters: strict - if true, will throw an exception if name is unknown. | public Collection<CommandLineSwitch> | getSwitches() | public boolean | getToggleSwitch(String name) | public boolean | isPresent(String name) | public boolean | isStrict() | public Collection<CommandLineException> | parse(String args) | public void | setParameterStrategy(ParameterStrategy parameterStrategy) | public void | setStrict(boolean strict) |
CommandLine | public CommandLine()(Code) | | |
CommandLine | public CommandLine(boolean strict)(Code) | | |
getSwitch | public CommandLineSwitch getSwitch(String name, boolean strict)(Code) | | Returns a
CommandLineSwitch matching name, if any.
Parameters: name - the name of the CommandLineSwitch to lookup. Parameters: strict - if true, will throw an exception if name is unknown. a CommandLineSwitch matching name. throws: IllegalArgumentException - if strict is true and name is unknown. |
getToggleSwitch | public boolean getToggleSwitch(String name)(Code) | | |
isStrict | public boolean isStrict()(Code) | | |
setStrict | public void setStrict(boolean strict)(Code) | | |
|
|