Java Reference
In-Depth Information
In this example, the Java EMF Model (JEM) is referenced by its
gener-
ated_package
, as shown here in its
plugin.xml
file:
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri="java.xmi"
class="org.eclipse.jem.java.JavaRefPackage" />
</extension>
RegisterEcoreFile
To explicitly register a metamodel using its
.ecore
file, use the
RegisterEcoreFile
element. In this example, the
mindmap.ecore
file is ref-
erenced from another project in the workspace:
<
bean
class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<
platformUri
value="../" />
<
RegisterEcoreFile
value=
"platform:/resource/org.eclipse.dsl.mindmap/model/mindmap.ecore"/>
</
bean
>
Note that it is possible to use any valid URI scheme in the value attribute.
For example, if you want to reference a file within a
*.jar
file, declare the path
as follows:
<
RegisterEcoreFile
value="jar:/file:/my.jar!/model/my.ecore"/>
ExtensionMap
If the EMF
extension_parser
extension-point is to be used to load a model,
you can use the
ExtensionMap
element, as shown here. Also shown is the con-
tribution from the corresponding model
plugin.xml
file.
<
bean
class="org.eclipse.emf.mwe.utils.StandaloneSetup">
<
platformUri
value="../" />
<
ExtensionMap
from="gmfgen"
to="org.eclipse.gmf.internal.codegen.util.GMFGenResource$Factory"/>
</
bean
>
<extension point="org.eclipse.emf.ecore.extension_parser">
<parser type="gmfgen" class=
"org.eclipse.gmf.internal.codegen.util.GMFGenResource$Factory"/>
</extension>
Search WWH ::
Custom Search