Sample Reflective Ecore Editor's Validator [message #1364497] |
Sun, 18 May 2014 14:23 |
John Smith Messages: 12 Registered: March 2014 |
Junior Member |
|
|
Dear All,
How can I programmatically execute the Sample Reflective Ecore Editor's validator on a specified Ecore instance model?
I need to verify a model, before I transform it. So I need a method that returns whether the specified model is valid.
Thank you for help in advance!
Best regards,
John
[Updated on: Sun, 18 May 2014 14:24] Report message to a moderator
|
|
|
|
Re: Sample Reflective Ecore Editor's Validator [message #1366476 is a reply to message #1365175] |
Mon, 19 May 2014 10:27 |
Ed Merks Messages: 33133 Registered: July 2009 |
Senior Member |
|
|
John,
Even simpler is
org.eclipse.emf.ecore.util.Diagnostician.validate(EObject) which returns
a diagnostic.
On 18/05/2014 11:19 PM, John Smith wrote:
> Here is the solution:
>
> BasicDiagnostic diagnostics = new BasicDiagnostic();
> Map<Object, Object> context = new HashMap<Object, Object>();
> Diagnostician.INSTANCE.validate(<EObject_to_be_validated>,diagnostics,context));
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02565 seconds