Parameters are used at two places: as subcommand values and as option values.
By default, args-inject supports:
By default, number of common types is converted from commandline String values. Custom types can be enhanced to be automatically translated.
Following sections describe how it can be done.
Define static valueOf method which:
Then this method will be used to produce instance of given class from a String.
This makes, for instance, all enumerations to be usable out of the box.
Working with lists in args-inject is supported two ways:
Lists are useful when you want to specify classpaths, exclussions, set of pages to print etc.
Lists are supported on parameters defined as java array.
You can use the @Param.listSeparator to explicitly set separator on given parameter; however, there is very nice algorithm to compute the default if you don't:
Have a look at MyPathTool sample to see it in action.
Note that the above applies to any component type.
When help prints parameter synopsis, it uses simple heuristic to derive a sensible name placeholder from the value type.
For instance, type java.io.File is printed as file, int is printed as int etc.
In most cases, it will be somewhat helpful to specify the @Param("myname") annottation to explicitly specify something more valid in the specific context.