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

  • Generic Java Type

    Hi,
    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?

    Thanks,

  • #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:

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

    Does this help?

    Comment


    • #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.

      Comment


      • #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?

        -Stefan

        Comment

        Working...
        X