Path through an EMF graph [message #1774187] |
Wed, 11 October 2017 08:56  |
Eclipse User |
|
|
|
All,
I need an EMF equivalent to XPath. i.e. A string that points to a value inside an EMF object graph. I need to--starting with an EObject, EAttribute, or EReference; which might be well nested--get the string I mentioned (a path reaching up container by container to the top, containing object) and vice versa. i.e. Starting with the string, navigating down to a object and updating an attribute(s).
Clearly, I can roll my own, but I would prefer to use something more standardized if such a thing exists.
Is there any such thing?
I realize one can always go from EMF to XML then hit it with XPath, but that's jumping through too many hoops.
Thanks
|
|
|
Re: Path through an EMF graph [message #1774307 is a reply to message #1774187] |
Thu, 12 October 2017 10:23  |
Eclipse User |
|
|
|
There are org.eclipse.emf.ecore.InternalEObject.eURIFragmentSegment(EStructuralFeature, EObject) and org.eclipse.emf.ecore.InternalEObject.eObjectForURIFragmentSegment(String) for creating path segments and traversing path segments, so an extension of that idea would allow the final segment to refer to an attribute's value and return it...
|
|
|
Powered by
FUDForum. Page generated in 0.26957 seconds