IKVM java.util.List error in remapping to properties!
Asked Answered
J

1

0

Domain: Public Transportation System
Language: Java
Tool: IKVM

I have a class Line which has a list of Stop.

A function getStops returns a List<Stop>.
To remap the List in the class as a .NET property, what XML shall I write??

I tried the following and it did not work!

<property name="Stops" sig="()[Lumple.pts.domain.coreEntities.Stop;">
    <getter name="getStops" sig="()Ljava.util.List<umple.pts.domain.coreEntities.Stop>;" />
    <setter name="setStops" sig="([Lumple.pts.domain.coreEntities.Stop;)Z" />
</property>

Also, there is another class EmergencyLine which has just 1 extra property: Status. How can inheritance be defined in IKVM, is it needed or not??

Jochebed answered 27/2, 2011 at 3:45 Comment(0)
L
0

The Java VM bytecodes don't support generics (they are implemented by "erasure" by the javac compiler).

The getter signature should be the same as the property signature.

For the inheritance, you shouldn't need to do anything.

Lierne answered 28/2, 2011 at 6:17 Comment(3)
Thanks. But, the [ sig="()Ljava.util.List;" ] didnt work, got an error.Jochebed
The getter is deemed invalid as the java.util.List is not same as the return type, which is a generic!Jochebed
Sorry, I didn't read your question carefully enough. I corrected the answer.Lierne

© 2022 - 2025 — McMap. All rights reserved.