Package | Description |
---|---|
org.apache.commons.cli2 | |
org.apache.commons.cli2.builder | |
org.apache.commons.cli2.commandline | |
org.apache.commons.cli2.option |
Modifier and Type | Interface and Description |
---|---|
interface |
Argument
An Option that can process values passed on the command line in the form
"--file README".
|
interface |
Group
An Option representing a choice or group of Options in the form "-a|-b|-c".
|
interface |
Parent
An Option that can have an argument and/or group of child Options in the form
"-f <arg> [-a|-b|-c]".
|
Modifier and Type | Method and Description |
---|---|
Option |
Option.findOption(String trigger)
Recursively searches for an option with the supplied trigger.
|
Option |
WriteableCommandLine.getCurrentOption()
Returns the option that is currently processed.
|
Option |
OptionException.getOption()
Gets the Option the exception relates to
|
Option |
HelpLine.getOption() |
Option |
CommandLine.getOption(String trigger)
Finds the Option with the specified trigger
|
Option |
Option.getParent()
Returns the parent of this option.
|
Modifier and Type | Method and Description |
---|---|
void |
WriteableCommandLine.addOption(Option option)
Adds an Option to the CommandLine
|
void |
WriteableCommandLine.addProperty(Option option,
String property,
String value)
Adds a property value to a name in the CommandLine.
|
void |
WriteableCommandLine.addSwitch(Option option,
boolean value)
Adds a switch value to an Option in the CommandLine.
|
void |
WriteableCommandLine.addValue(Option option,
Object value)
Adds a value to an Option in the CommandLine.
|
void |
Argument.defaultValues(WriteableCommandLine commandLine,
Option option)
Adds defaults to a CommandLine.
|
int |
CommandLine.getOptionCount(Option option)
Retrieves the number of times the specified Option appeared in this
CommandLine
|
Set |
CommandLine.getProperties(Option option)
Retrieves the set of all property names associated with this option
|
String |
CommandLine.getProperty(Option option,
String property)
Retrieves the value associated with the specified property
|
String |
CommandLine.getProperty(Option option,
String property,
String defaultValue)
Retrieves the value associated with the specified property
|
Boolean |
CommandLine.getSwitch(Option option)
Retrieves the Boolean value associated with the specified Switch
|
Boolean |
CommandLine.getSwitch(Option option,
Boolean defaultValue)
Retrieves the Boolean value associated with the specified Switch
|
List |
WriteableCommandLine.getUndefaultedValues(Option option)
Retrieves the Argument values specified on the command line for the
specified Option, this doesn't return any values supplied
programmatically as defaults.
|
Object |
CommandLine.getValue(Option option)
Retrieves the single Argument value associated with the specified Option
|
Object |
CommandLine.getValue(Option option,
Object defaultValue)
Retrieves the single Argument value associated with the specified Option
|
List |
CommandLine.getValues(Option option)
Retrieves the Argument values associated with the specified Option
|
List |
CommandLine.getValues(Option option,
List defaultValues)
Retrieves the Argument values associated with the specified Option
|
boolean |
CommandLine.hasOption(Option option)
Detects the presence of an option in this CommandLine.
|
void |
Argument.processValues(WriteableCommandLine commandLine,
ListIterator args,
Option option)
Processes the "README" style element of the argument.
|
void |
WriteableCommandLine.setCurrentOption(Option currentOption)
Sets the current option.
|
void |
WriteableCommandLine.setDefaultSwitch(Option option,
Boolean defaultSwitch)
Sets the default state for a Switch in the CommandLine.
|
void |
WriteableCommandLine.setDefaultValues(Option option,
List defaultValues)
Sets the default values for an Option in the CommandLine
|
void |
Option.setParent(Option parent)
Sets the parent of this option.
|
void |
Argument.validate(WriteableCommandLine commandLine,
Option option)
Performs any necessary validation on the values added to the
CommandLine.
|
Constructor and Description |
---|
OptionException(Option option)
Creates a new OptionException.
|
OptionException(Option option,
String messageKey)
Creates a new OptionException.
|
OptionException(Option option,
String messageKey,
String value)
Creates a new OptionException.
|
Modifier and Type | Method and Description |
---|---|
Option |
PatternBuilder.create()
Creates a new Option instance.
|
Modifier and Type | Method and Description |
---|---|
GroupBuilder |
GroupBuilder.withOption(Option option)
Add this option to the group
|
Modifier and Type | Method and Description |
---|---|
Option |
WriteableCommandLineImpl.getCurrentOption() |
Option |
PreferencesCommandLine.getOption(String trigger) |
Option |
DefaultingCommandLine.getOption(String trigger) |
Option |
PropertiesCommandLine.getOption(String trigger) |
Option |
WriteableCommandLineImpl.getOption(String trigger) |
Modifier and Type | Method and Description |
---|---|
void |
WriteableCommandLineImpl.addOption(Option option) |
void |
WriteableCommandLineImpl.addProperty(Option option,
String property,
String value) |
void |
WriteableCommandLineImpl.addSwitch(Option option,
boolean value) |
void |
WriteableCommandLineImpl.addValue(Option option,
Object value) |
int |
CommandLineImpl.getOptionCount(Option option) |
Set |
PreferencesCommandLine.getProperties(Option option) |
Set |
DefaultingCommandLine.getProperties(Option option) |
Set |
PropertiesCommandLine.getProperties(Option option) |
Set |
WriteableCommandLineImpl.getProperties(Option option) |
String |
CommandLineImpl.getProperty(Option option,
String property) |
String |
PreferencesCommandLine.getProperty(Option option,
String property,
String defaultValue) |
String |
DefaultingCommandLine.getProperty(Option option,
String property,
String defaultValue) |
String |
PropertiesCommandLine.getProperty(Option option,
String property,
String defaultValue) |
String |
WriteableCommandLineImpl.getProperty(Option option,
String property,
String defaultValue) |
Boolean |
CommandLineImpl.getSwitch(Option option) |
Boolean |
PreferencesCommandLine.getSwitch(Option option,
Boolean defaultValue) |
Boolean |
DefaultingCommandLine.getSwitch(Option option,
Boolean defaultValue) |
Boolean |
PropertiesCommandLine.getSwitch(Option option,
Boolean defaultValue) |
Boolean |
WriteableCommandLineImpl.getSwitch(Option option,
Boolean defaultValue) |
List |
WriteableCommandLineImpl.getUndefaultedValues(Option option) |
Object |
CommandLineImpl.getValue(Option option) |
Object |
CommandLineImpl.getValue(Option option,
Object defaultValue) |
List |
CommandLineImpl.getValues(Option option) |
List |
PreferencesCommandLine.getValues(Option option,
List defaultValues) |
List |
DefaultingCommandLine.getValues(Option option,
List defaultValues) |
List |
PropertiesCommandLine.getValues(Option option,
List defaultValues) |
List |
WriteableCommandLineImpl.getValues(Option option,
List defaultValues) |
boolean |
PreferencesCommandLine.hasOption(Option option) |
boolean |
DefaultingCommandLine.hasOption(Option option) |
boolean |
PropertiesCommandLine.hasOption(Option option) |
boolean |
WriteableCommandLineImpl.hasOption(Option option) |
void |
WriteableCommandLineImpl.setCurrentOption(Option currentOption) |
void |
WriteableCommandLineImpl.setDefaultSwitch(Option option,
Boolean defaultSwitch) |
void |
WriteableCommandLineImpl.setDefaultValues(Option option,
List defaults) |
void |
Parser.setHelpOption(Option helpOption)
Sets the help option to use with the simplified parsing.
|
Constructor and Description |
---|
PreferencesCommandLine(Option root,
Preferences preferences)
Creates a new PreferencesCommandLine using the specified root Option and
Preferences node.
|
PreferencesCommandLine(Option root,
Preferences preferences,
char separator)
Creates a new PreferencesCommandLine using the specified root Option,
Preferences node and value separator.
|
PropertiesCommandLine(Option root,
Properties properties)
Creates a new PropertiesCommandLine using the specified root Option,
Properties instance.
|
PropertiesCommandLine(Option root,
Properties properties,
char separator)
Creates a new PropertiesCommandLine using the specified root Option,
Properties instance and value separator.
|
WriteableCommandLineImpl(Option rootOption,
List arguments)
Creates a new WriteableCommandLineImpl rooted on the specified Option, to
hold the parsed arguments.
|
Modifier and Type | Class and Description |
---|---|
class |
ArgumentImpl
An implementation of an Argument.
|
class |
Command
Represents a cvs "update" style command line option.
|
class |
DefaultOption
A Parent implementation representing normal options.
|
class |
GroupImpl
An implementation of Group
|
class |
OptionImpl
A base implementation of Option providing limited ground work for further
Option implementations.
|
class |
ParentImpl
A base implementation of Parent providing limited ground work for further
Parent implementations.
|
class |
PropertyOption
Handles the java style "-Dprop=value" opions
|
class |
SourceDestArgument
An Argument implementation that allows a variable size Argument to precede a
fixed size argument.
|
class |
Switch
A Parent implementation representing normal switch options.
|
Modifier and Type | Method and Description |
---|---|
Option |
GroupImpl.findOption(String trigger) |
Option |
OptionImpl.findOption(String trigger) |
Option |
ParentImpl.findOption(String trigger) |
Option |
HelpLineImpl.getOption() |
Option |
OptionImpl.getParent() |
Modifier and Type | Method and Description |
---|---|
void |
ArgumentImpl.defaultValues(WriteableCommandLine commandLine,
Option option) |
void |
ArgumentImpl.processValues(WriteableCommandLine commandLine,
ListIterator arguments,
Option option) |
void |
OptionImpl.setParent(Option parent) |
void |
ArgumentImpl.validate(WriteableCommandLine commandLine,
Option option) |
void |
SourceDestArgument.validate(WriteableCommandLine commandLine,
Option option) |
Constructor and Description |
---|
HelpLineImpl(Option option,
int indent)
Creates a new HelpLineImpl to represent a particular Option in the online
help.
|
Copyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.