在我的 Ecore 模型中,来自当前模型外部的所有类型都不会由其代理解析。返回对象的所有字段getType()
are null
并且运行时只填写存储类型URI。
这是我的模型的摘录:
<?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>
目前如果我做一个
Address a = <address item from model>
Type t = a.getType();
所有领域的t
将null
和toString()
返回类似以下内容:
org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl@6e315086 (eProxyURI:
platform:/plugin/org.eclipse.uml2.types/model/Types.ecore#//String)
更改代理 URIplatform:/plugin/org.eclipse.uml2.types/model/Types.ecore#//String
包含包含数据类型的包的 NS URI:http://www.eclipse.org/uml2/4.0.0/Types#//String
.
注意此更改只能在文本编辑器中完成.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)