Announcement Announcement Module
No announcement yet.
Generic Java Type Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Generic Java Type

    I'm developing an addon to Roo, and I'm trying to generate classes with Generic Types.
    I managed to generate Generic JavaType (List<Object>) with extended constructor. But when Roo parses this file it tells me:

    Illegal name 'List<Pertsona>' (illegal character)

    How can I parse this?


  • #2
    I am not sure what exactly is being generated and how you do that without seeing any code and the exception. However, from the information you have provided you want to create a JavaType with generics. The best way to go about this is to look at the existing sources which generate similar things to what you want to achieve. Here is an example:

    List<JavaType> params = new ArrayList<JavaType>();
    params.add(new JavaType(""));
    JavaType setType = new JavaType("java.util.Set", 0, DataType.TYPE, null, params);
    This would generate a Set<Order>.

    Does this help?


    • #3
      Wow, sorry.
      I'm only have this problem in my addon. When I use generic types in SpringRoo without addons this runs correctly.

      Sorry and Thanks.


      • #4
        No need to be sorry. We are here to help! As I said, if you want to get help with your specific problem I would be glad to take a look. Just share the relevant code and exception and we can take a closer look.

        May I ask what the addon is about?