IKVM java.util.List 重新映射到属性时出错!

发布于 2024-10-19 07:24:20 字数 637 浏览 14 评论 0原文

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

我有一个类Line,其中包含Stop 列表。

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

我尝试了以下方法,但没有成功!

<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,它只有 1 个额外属性:Status。 IKVM中如何定义继承,是否需要?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

恍梦境° 2024-10-26 07:24:20

Java VM 字节码不支持泛型(它们是通过 javac 编译器“擦除”实现的)。

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

为了继承,你不需要做任何事情。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文