在Eclipse中使用不同的版本加载两次相同的插件

编程入门 行业动态 更新时间:2024-10-10 05:18:57
本文介绍了在Eclipse中使用不同的版本加载两次相同的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我有两个不同版本的EMF插件加载了一个.xmi。后一版本已更改,以便以前版本的xmi不兼容。我想做的是使用第一个插件加载xmi,然后使用较新的插件编程构建一个模型,从而迁移旧的模型。除了EMF模型中的某些更改外,它们是完全相同的。

如何加载这些插件?可能吗?有更好的策略吗?

解决方案

我建议更改旧版本的ID(可能是EMF包URI),所以你可以同时使用两个代码和模型。

由于您需要在同一个插件(迁移器)中处理旧的和新的类,所以没有办法可以同时工作。

但是,您将看到动态EMF技术,您可以在没有生成的软件包的情况下打开旧模型(另一方面,您必须使用反射API)。使用这种方法,您可以编写一个转换器,它使用EMF反射API打开旧模型,并手动将其转换为新模型版本。

I have two different versions of an EMF plugin which loads a certain .xmi. The latter version has been changed so that the xmi from the previous version is incompatible. What I want to do is to load the xmi's with the first plugin and then programatically build a model using the newer plugin thus migrating older models. They are identical apart from some changes within an EMF model.

How do I load these plugins? Is it possible? Are there better strategies?

解决方案

I suggest changing the id of the old version (and possibly the EMF package URI), so you can have the two code and models simultaneously.

As you need to handle both old and new classes in the same plug-in (the migrator), there is no way you can have both working.

However, you shall look at the dynamic EMF technology where you could open the old model without its generated packages (on the other hand, you have to use the reflective API). Using this method you can write a converter, that opens the old model using EMF reflective API, and manually translate it into your new model version.

更多推荐

在Eclipse中使用不同的版本加载两次相同的插件

本文发布于:2023-11-13 11:15:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584211.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:两次   插件   加载   版本   Eclipse

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!