|
|
Re: Convert Path in XMI [message #1785657 is a reply to message #1785634] |
Wed, 18 April 2018 05:59 |
Ed Merks Messages: 33137 Registered: July 2009 |
Senior Member |
|
|
Note that the first serialization looks like it's was produced by org.eclipse.emf.ecore.impl.EModelElementImpl.eURIFragmentSegment(EStructuralFeature, EObject) and is interpreted by org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(String). You could have a look at org.eclipse.emf.ecore.util.EcoreUtil.getRelativeURIFragmentPath(EObject, EObject, boolean) and at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getURIFragment(EObject) to see how fragment paths are generally computed by the objects themselves and at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(List<String>) to see how they are interpreted by the objects themselves. This is all to say that there is no general mechanism to convert from oneform of path to the other but rather the implementation classes can be (are) specialized to determine which form is produced and of course must have a corresponding specialization to ensure that such a fragment path segment can also be interpreted. So perhaps the better approach is to ensure that your specialized UML model can interpret the fragment paths the same way as the unspecialized UML2. Generally specializations should be able to interpret the default syntax, e.g., org.eclipse.emf.ecore.impl.EModelElementImpl.eObjectForURIFragmentSegment(String) calls super when the first character in the path segment is an @.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.01854 seconds