简体   繁体   English

动态加载package-eclipse

[英]dynamic loading of package-plugin eclipse

I am developing a plugin in eclipse, which is a metrics view that will show a list of syntactic metrics(of Xtext files). 我正在eclipse中开发一个插件,该插件是一个指标视图,将显示(Xtext文件的)语法指标列表。 the plugin is written in java, as a plugin project in eclipse. 该插件是用Java编写的,是eclipse中的一个插件项目。

How can I load dynamically from the Activator (the file that created in eclipse plugin project) all classes from a certain package,directly to the metric table I prepare. 如何从激活程序(在eclipse插件项目中创建的文件)动态加载某个包中的所有类,然后直接将其加载到我准备的指标表中。

I searched about it and didn't find any guides or useful information to help me with this issue. 我进行了搜索,但没有找到任何指南或有用的信息来帮助我解决此问题。

Thanks! 谢谢!

Basically eclipse plugins are osgi bundles. 基本上,eclipse插件是osgi捆绑包。 Since each osgi bundle (ie eclipse plugin) has a own classloader try using that class loader to resolve related resources. 由于每个osgi捆绑包(即eclipse插件)都有自己的类加载器,请尝试使用该类加载器来解析相关资源。

See How to get classloader for a bundle in equinox? 请参阅如何在春分点中获取捆绑软件的类加载器?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM