Loading class from extension point [message #1107507] |
Thu, 12 September 2013 14:02 |
|
Hi all,
We have an extension point which specifies class name as one of its attribute. We need to obtain the class instance from the provided class name String.
So far we only find IConfigurationElement#createExecutableExtension, but this one creates object instance instead of class instance. Actually we need something like Bundle#loadClass, but how to get reference to Bundle from IExtensionRegistry ?
Any help would be greatly appreciated.
Thanks & Regards,
Setya
|
|
|
Re: Loading class from extension point [message #1107968 is a reply to message #1107507] |
Fri, 13 September 2013 06:22 |
|
Hi all,
I've found the following works:
Bundle bundle = OSGIUtils.getDefault().getBundle(element.getContributor().getName());
Class<?> clazz = bundle.loadClass(className);
But the thing is OSGIUtils is internal, so I'm open for any suggestions.
Thanks & Regards,
Setya
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02891 seconds