EProxy URI does not resolve in ecore model

帅比萌擦擦* 提交于 2019-12-22 04:35:16

问题


In my Ecore model all types that come from outside the current model are not resolved by their proxies. All fields of the object returned by getType() are null and only the storage type URI is filled in at runtime.

Here is an extract of my model:

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model" nsURI="http:///model.ecore" nsPrefix="model">
  <eSubpackages name="general" nsURI="http:///model/general.ecore" nsPrefix="model.general">
    <eClassifiers xsi:type="ecore:EClass" name="Address">
      <eStructuralFeatures xsi:type="ecore:EAttribute" name="street" ordered="false" lowerBound="1"
      eType="ecore:EDataType platform:/plugin/org.eclipse.uml2.types/model/Types.ecore#//String"/>
    </eClassifiers>
  </eSubpackages>
</ecore:EPackage>

Currently if I make an

Address a = <address item from model>
Type t = a.getType();

all fields of t will be null and the toString() returns something like:

org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl@6e315086 (eProxyURI:
 platform:/plugin/org.eclipse.uml2.types/model/Types.ecore#//String)

回答1:


Change the proxy URIs from platform:/plugin/org.eclipse.uml2.types/model/Types.ecore#//String to contain the NS URI of the package that contains the data type: http://www.eclipse.org/uml2/4.0.0/Types#//String.

Note that this change can only be done in a textual editor.



来源:https://stackoverflow.com/questions/17213348/eproxy-uri-does-not-resolve-in-ecore-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!