Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Generics support

2008-05-28
2013-04-29
  • Peter Schubert
    Peter Schubert
    2008-05-28

    Hi,

    When is generics support going to be available?

    I managed to change the source code to get it working for now, but i'd rather use a stable release in production.

    If this isn't possible, I may have to consider another library.

     
    • aalmiray
      aalmiray
      2008-05-28

      Peter,

      Generics support is planned for 2.3 (no release date yet). We have received 2 different patches so far, with 2 different approaches but they do not solve the whole picture, as deeply nested generics info in Lists is not taken into account. This means you can't write the following at the moment

      List<Map<Integer,String>> list = JSONSerializer.toJava( json );

      but

      List<Map> list = JSONSerializer.toJava( json );

      Patches are welcome =)

       
    • Peter Schubert
      Peter Schubert
      2008-06-12

      For my selfish needs, I would only need basic generics support, i.e. lists and maps of primitive types.

      For the big picture, how about using the Type abstraction instead of Class? This way you could extract arbitrarily nested generics info at any point in the implementation.