args4j comes with a built-in support for parsing options into several Java datatypes (such as <<>>, <<>>, and <<>>). You can extend this further by writing your own {{{apidocs/org/kohsuke/args4j/spi/OptionHandler.html}OptionHandler}} implementation, then registering it to the <<>> class. In fact, most of the built-in support is implemented using this mechanism. The <<>> class's source code details how to do this.