An Ecore model can be used outside the plugin-environment by manually registering the file extension and the ResourceFactory with the following command, in this case for XML:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xml", new XMLResourceFactoryImpl());
My Ecore model only contains a Factory (extends EFactory
). Where can I get the necessary ResourceFactory?
You need to include in your classpath EMF *.jar files.
Here you can find more information: https://wiki.eclipse.org/EMF/FAQ#I_want_to_use_EMF.2C_SDO.2C_or_XSD_in_my_standalone_project.2C_or_include_only_a_working_subset_of_the_code._What_libraries_.28jar_files.29_do_I_need_in_my_CLASSPATH.3F
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.