Sample Reflective Ecore Editor's Validator [message #1364497] |
Sun, 18 May 2014 10:23  |
Eclipse User |
|
|
|
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 10:24] by Moderator
|
|
|
|
Re: Sample Reflective Ecore Editor's Validator [message #1366476 is a reply to message #1365175] |
Mon, 19 May 2014 06:27  |
Eclipse User |
|
|
|
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));
>
|
|
|
Powered by
FUDForum. Page generated in 1.29898 seconds