| [news.eclipse.tools.emf] Re: User data in validation |
Christian,
Comments inline.
Hi, Vasanth,
No, currently there is no such facility. I think in the EValidator API, the context map is geared towards utilities that are known to and provided by EMF, such as SubstitutionLabelProviders. It can be assumed that constraints in an EValidator will know what to do with these general-purpose context objects, but not application-specific objects.
The assumption in the ModelValidationService is that if constraints are so
tightly coupled with an application that they need to exchange such context
data, then they can provide their own communication channel separately from
the validation framework. I'm not sure that this is always practical.
Certainly, we're open to proposals to enhance this part of the API.
Thanks, Vasanth
Cheers,
Christian
Vasanth Velusamy wrote:
When using the EMF Validation Framework (ModelValidationService along with constraints), how do I provide user-defined context data to the constraints? AbstractModelConstraint.validate() provides an IValidationContext from which I am able to retrieve the target and other details, but how can I provide user context data to the constraint? I understand that IValidationContext.get/putCurrentConstraintData() is for a different purpose.
In the EValidator api, I see that Diagnostician.validate() gives the option to add user data as a context map (Map<Object, Object> context).
Is there something similar when using the EMF Validation Framework?
Thanks, Vasanth