[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.emf] Re: Mapping EObject Objects to Diagnostic Objects

Felix,

Oops, wrong button. :-P

Comments below.

Ed Merks wrote:
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.
Too short! If these things were longer, Dave would have taken another year!!

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).
Sounds like a a helper method you could write...

Is something like this available through the framework, or do I need to manually compute the Map based on the Diagnostic tree?
Manually.


What's the role of the "context" map argument in the Diagnostician's validate() methods? Unfortunately there's no information in the Javadoc.
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.


Thanks,
Felix