[Jewelcli-users] Fwd: ParameterizedTypeImp support for an @Option
java command line option processing library
Brought to you by:
flamingpenguin
From: Eduard W. <edi...@gm...> - 2011-10-08 23:15:35
|
Hi, Appologies for the possible duplicate email to the mailing list. I'm trying to use a generalized type as a return type for an option. @Option(...) SomeType<SomeOtherType> getSomeType(); This fails with java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class at uk.co.flamingpenguin.jewel.cli.ArgumentSpecificationImpl.<init>(ArgumentSpecificationImpl.java:25) at uk.co.flamingpenguin.jewel.cli.OptionSpecificationImpl.<init>(OptionSpecificationImpl.java:22) at uk.co.flamingpenguin.jewel.cli.OptionsSpecificationImpl.<init>(OptionsSpecificationImpl.java:44) at uk.co.flamingpenguin.jewel.cli.CliImpl.<init>(CliImpl.java:24) at uk.co.flamingpenguin.jewel.cli.CliFactory.createCli(CliFactory.java:23) Seems generalized types are supported for lists, but not for "non-list" types. Is there any way I could use a generalized type as per the setup I have above? Also, is the project still being maintained/developed, would you be interested in a patch adding support for the above (in case its not there yet)? Thanks, Eduard |