在Eclipse中使用不同的版本加载两次相同的插件 [英] Loading same plugin twice with different version in Eclipse

查看:211
本文介绍了在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中使用不同的版本加载两次相同的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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