In my Ecore model, all types that come from outside the current model are not allowed by their proxies. All fields of the object returned by getType() are null , and at run time only the storage type URI is populated.
Here is an excerpt from 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 create
Address a = <address item from model> Type t = a.getType();
all t fields will be null , and toString() returns something like:
org.eclipse.uml2.uml.internal.impl.PrimitiveTypeImpl@6e315086 (eProxyURI: platform:/plugin/org.eclipse.uml2.types/model/Types.ecore#//String)
allprog
source share