| [news.eclipse.tools.emf] Re: Mapping EObject Objects to Diagnostic Objects |
Felix,
Oops, wrong button. :-P
Comments below.
Too short! If these things were longer, Dave would have taken another year!!Felix
Felix Dorner wrote:Hey,
I have read the (too short, but 1000 times better than nothing) chapter on EMF Validation in the Rough Cuts Book, and have a small doubt, please correct if I make wrong assumptions.
Sounds like a a helper method you could write...
I call Diagnostician.eINSTANCE.validate(myContainmentRoot), to validate my whole model which gives me a tree-like structure consisting of Diagnostic objects.
From a certain Diagnostic object, I can then get the involved model object(s) via the Diagnostic's getData() method.
I'd rather like to have a Map<EObject,List<Diagnostic>>, which would map a given eObject to all the Diagnostic's it is involved (i.e. its getData() contains the eObject).
Manually.
Is something like this available through the framework, or do I need to manually compute the Map based on the Diagnostic tree?
Generally it's a place where complex constraints can cache information so that expensive computations don't need to be duplicated across several constraint that might need the same information.
What's the role of the "context" map argument in the Diagnostician's validate() methods? Unfortunately there's no information in the Javadoc.
Thanks, Felix