[英]Registering an Ecore model in a standalone Java application
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: 通过使用以下命令手动注册文件扩展名和ResourceFactory,可以在插件环境之外使用Ecore模型,在本例中为XML:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xml", new XMLResourceFactoryImpl());
My Ecore model only contains a Factory (extends EFactory
). 我的Ecore模型仅包含一个Factory(扩展了
EFactory
)。 Where can I get the necessary ResourceFactory? 在哪里可以获得必要的ResourceFactory?
You need to include in your classpath EMF *.jar files. 您需要在类路径EMF * .jar文件中包含它。
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 在这里您可以找到更多信息: 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.ne_3_PATH_in_my_stand_of_the_code
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.