org.biojava.bio.structure.align.util
public class CliTools extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
configureBean(java.lang.Object bean,
java.lang.String[] args)
Configure a JavaBean based on a set of command line arguments.
|
public static java.lang.String[] configureBean(java.lang.Object bean, java.lang.String[] args) throws ConfigurationException
BeanInfo
(usually obtained by introspection)
to find a property named "foo". The argument will be interpreted
according to the type of the "foo" property, then the appropriate
mutator method (generally named setFoo) will be called to configure
the property on the bean.
Currently supported property types are int, double,
boolean, String, File, Reader, Writer, InputStream, OutputStream
,
plus arrays of all the above types. In the case of arrays, the option
may appear multiple times on the command line, otherwise recurrance of
the same option is an error.
For stream types, the parameter is interpreted as a filename unless it is equal to "-" in which case standard input or standard output are used as appropriate. Each of the standard streams may only be used one.
In the future, this method will probably be extended to handle multiple parameter occurances, and use Annotations to generate more useful help messages when something goes wrong.
bean
- args
- ConfigurationException