com.beust.jcommander
Class JCommander
java.lang.Object
com.beust.jcommander.JCommander
public class JCommander
- extends Object
The main class for JCommander. It's responsible for parsing the object that contains
all the annotated fields, parse the command line and assign the fields with the correct
values and a few other helper methods, such as usage().
The object(s) you pass in the constructor are expected to have one or more
- Author:
- cbeust
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG_PROPERTY
public static final String DEBUG_PROPERTY
- See Also:
- Constant Field Values
JCommander
public JCommander(Object object)
JCommander
public JCommander(Object object,
ResourceBundle bundle,
String... args)
JCommander
public JCommander(Object object,
String... args)
parse
public void parse(String... args)
- Parse the command line parameters.
usage
public void usage()
- Display a the help on System.out.
getParameters
public List<ParameterDescription> getParameters()
- 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).
setDefaultProvider
public void setDefaultProvider(IDefaultProvider defaultProvider)
- Define the default provider for this instance.
addConverterFactory
public void addConverterFactory(IStringConverterFactory converterFactory)
findConverter
public <T> Class<? extends IStringConverter<T>> findConverter(Class<T> cls)
Copyright © 2010. All Rights Reserved.