| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| private class | |
| pack-priv static class | JCommander.
Description of a main parameter, which can be either a list of string or a single field. |
| private static class | JCommander.
Options shared with sub commands |
| public static class | JCommander.
Encapsulation of either a main application or an individual command. |
| Modifier and Type | Field and Description |
|---|---|
| private Map | aliasMap
Alias database for reverse lookup |
| private Map | commands
List of commands and their instance. |
| private Console | |
| public static final String | |
| private final IVariableArity | |
| private Map | descriptions
A map to look up parameter description per option name. |
| private Map | fields
A map of all the parameterized fields/methods. |
| private boolean | |
| private JCommander. | |
| private List | objects
The objects that contain fields annotated with @Parameter. |
| private final JCommander. | |
| protected IParameterizedParser | |
| private String | parsedAlias
The name of command or alias as it was passed to the command line |
| private String | parsedCommand
The name of the command after the parsing has run. |
| private JCommander. | |
| private Map | requiredFields
A set of all the parameterizeds that are required. |
| private List | |
| private IUsageFormatter | usageFormatter
The usage formatter to use in |
| Access | Constructor and Description |
|---|---|
| private | |
| public | |
| public | |
| public | JCommander(Object
The arg object expected to contain object, ResourceBundle Parameter annotations.The bundle to use for the descriptions. Can be null. bundle)
|
| public | JCommander(Object
The arg object expected to contain object, ResourceBundle Parameter annotations.The bundle to use for the descriptions. Can be null. bundle, String... The arguments to parse (optional). args)
|
| public | JCommander(Object
The arg object expected to contain object, String... Parameter annotations.The arguments to parse (optional). args)
Deprecated
Construct a JCommander instance first and then call parse() on it.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public void | addConverterFactory(final IStringConverterFactory
the factory determining string converters converterFactory)Adds a factory to lookup string converters. |
| public void | addConverterInstanceFactory(IStringConverterInstanceFactory
the factory generating string converter instances converterInstanceFactory)Adds a factory to lookup string converters. |
| private void | |
| public final void | |
| public Object | convertValue(final Parameterized parameterized, Class<T>
The type of the actual parameter type, String optionName, String The value to convert value)
|
| public void | |
| private final int | |
| private String[] | Returns: the new and enriched command line parametersthe original command line parameters originalArgv)Expand the command line parameters to take @ parameters into account. |
| private List | |
| private JCommander | |
| public JCommander | |
| private IStringConverter | |
| private ParameterDescription | |
| private JCommander. | |
| public ResourceBundle | |
| public int | |
| public Map | |
| public synchronized Console | |
| private ParameterDescription | getDescriptionFor(String arg)
If arg is an option, we can look it up directly, but if it's a value, we need to find the description for the option that precedes it. |
| public Map | |
| public Map | |
| public JCommander. | |
| public String | |
| public ParameterDescription | |
| public List | Returns: the objects that JCommander will fill with the result of parsing the command line.
|
| public JCommander. | |
| public Comparator | |
| public List | Returns: a Collection of all the \@Parameter annotations found on the target class. This can be used to display the usage() in a different format (e.g. HTML).
|
| public String | Returns: Name of command or alias passed to command line. If none passed:null.The name of the command or the alias in the form it was passed to the command line. |
| public String | |
| private ParameterDescription | |
| public String | |
| public String | |
| public Map | |
| private String | |
| public List | |
| public IUsageFormatter | |
| private void | |
| private void | |
| private void | |
| private void | |
| private static <T> T | |
| private boolean | |
| private boolean | |
| public boolean | |
| private boolean | |
| public static JCommander. | |
| private void | |
| public void | |
| private void | |
| private void | parseValues(String[] args, boolean validate)
Main method that parses the values and initializes the fields accordingly. |
| public void | |
| private static String | |
| private int | processFixedArity(String[] args, int index, ParameterDescription pd, boolean validate, Class<?> fieldType)
|
| private int | processFixedArity(String[] args, int originalIndex, ParameterDescription pd, boolean validate, Class<?> fieldType, int arity)
|
| private int | Returns: the number of options that were processed.
|
| private int | Returns: the number of options that were processed.
|
| private List | |
| private char[] | readPassword(String description, boolean echoInput)
Invoke Console.readPassword through reflection to avoid depending on Java 6. |
| private String | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public final void | setDescriptionsBundle(ResourceBundle bundle)
Sets the |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setProgramName(String
program name name, String... aliases to the program name aliases)Set the program name |
| public void | |
| public void | |
| private String[] | |
| private static String | |
| private static <T> T | |
| public void | |
| private void |