IKVM java.util.List重新映射到属性时出错! [英] IKVM java.util.List error in remapping to properties!

查看:138
本文介绍了IKVM java.util.List重新映射到属性时出错!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

域:公共交通系统
语言:Java
工具:IKVM

Domain: Public Transportation System
Language: Java
Tool: IKVM

我有一个类Line,其中有一个Stop列表.

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

函数getStops返回List<Stop>.
要将类中的List重新映射为.NET属性,我应该写什么XML?

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>

此外,还有另一个类EmergencyLine,它只有一个额外的属性:Status.是否需要在IKVM中定义继承?

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

推荐答案

Java VM字节码不支持泛型(它们由javac编译器通过擦除"实现).

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

getter签名应与属性签名相同.

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

对于继承,您不需要做任何事情.

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

这篇关于IKVM java.util.List重新映射到属性时出错!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆